aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-07-19 16:54:28 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-17 21:34:53 +0200
commit4f60da3846d9cd0528f9e7733c58c4aad33002d2 (patch)
tree602be805702d044ae3d54b126918e06405e28472
parentcc7f140e0f2fbf39843e9a57baebff7d96f7235b (diff)
downloadffmpeg-4f60da3846d9cd0528f9e7733c58c4aad33002d2.tar.gz
avformat/cdg: Fix integer overflow in duration computation
Fixes: signed integer overflow: 8398407 * 300 cannot be represented in type 'int' Fixes: 23914/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-4702539290509312 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit aa8935b395162f8438d1f055e671e92685ed1586) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/cdg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/cdg.c b/libavformat/cdg.c
index baf37d4c6a..103ef99847 100644
--- a/libavformat/cdg.c
+++ b/libavformat/cdg.c
@@ -49,7 +49,7 @@ static int read_header(AVFormatContext *s)
if (ret < 0) {
av_log(s, AV_LOG_WARNING, "Cannot calculate duration as file size cannot be determined\n");
} else
- vst->duration = (ret * vst->time_base.den) / (CDG_PACKET_SIZE * 300);
+ vst->duration = (ret * (int64_t)vst->time_base.den) / (CDG_PACKET_SIZE * 300);
return 0;
}