Skip to content

Commit

Permalink
avoid division by 0 false positive
Browse files Browse the repository at this point in the history
Signed-off-by: Rosen Penev <[email protected]>
  • Loading branch information
neheb committed Jul 2, 2023
1 parent 4783581 commit d18a218
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/quicktimevideo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1155,9 +1155,12 @@ void QuickTimeVideo::timeToSampleDecoder() {
io_->readOrThrow(buf.data(), 4);
timeOfFrames = Safe::add(timeOfFrames, temp * buf.read_uint32(0, bigEndian));
}
if (currentStream_ == Video)
if (currentStream_ == Video) {
if (timeOfFrames == 0)
timeOfFrames = 1;
xmpData_["Xmp.video.FrameRate"] =
static_cast<double>(totalframes) * static_cast<double>(timeScale_) / static_cast<double>(timeOfFrames);
}
} // QuickTimeVideo::timeToSampleDecoder

void QuickTimeVideo::sampleDesc(size_t size) {
Expand Down

0 comments on commit d18a218

Please sign in to comment.