From 9d044d30b17b098e6b65829bdd9ba584f6c6ccca Mon Sep 17 00:00:00 2001 From: Kevin Backhouse Date: Mon, 21 Nov 2022 10:50:39 +0000 Subject: [PATCH] Use Safe::add --- src/quicktimevideo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/quicktimevideo.cpp b/src/quicktimevideo.cpp index 882f19ab..00db1fc1 100644 --- a/src/quicktimevideo.cpp +++ b/src/quicktimevideo.cpp @@ -1102,9 +1102,9 @@ void QuickTimeVideo::timeToSampleDecoder() { for (uint32_t i = 0; i < noOfEntries; i++) { io_->readOrThrow(buf.data(), 4); const uint64_t temp = buf.read_uint32(0, bigEndian); - totalframes += temp; + totalframes = Safe::add(totalframes, temp); io_->readOrThrow(buf.data(), 4); - timeOfFrames += temp * buf.read_uint32(0, bigEndian); + timeOfFrames = Safe::add(timeOfFrames, temp * buf.read_uint32(0, bigEndian)); } if (currentStream_ == Video) xmpData_["Xmp.video.FrameRate"] = (double)totalframes * (double)timeScale_ / (double)timeOfFrames;