aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-06-23 01:01:53 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-01 12:49:26 +0200
commit69eca43d61ad91cce15668a98f78a4183670cf2f (patch)
tree4720c99a444658f66efdcece55158335fdc1edf0 /libavformat
parent620374a3af3e5b506e39713dadfde9d3ac9ca0f6 (diff)
downloadffmpeg-69eca43d61ad91cce15668a98f78a4183670cf2f.tar.gz
avformat/mvdec: Fix integer overflow with billions of channels
Fixes: signed integer overflow: 1394614304 * 2 cannot be represented in type 'int' Fixes: 23491/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5697377020411904 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 b6fbbe08c325415cc784df296058beb6604f0b9c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mvdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c
index c2eed0c650..e7c743cd8e 100644
--- a/libavformat/mvdec.c
+++ b/libavformat/mvdec.c
@@ -260,7 +260,7 @@ static void read_index(AVIOContext *pb, AVStream *st)
avio_skip(pb, 8);
av_add_index_entry(st, pos, timestamp, size, 0, AVINDEX_KEYFRAME);
if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
- timestamp += size / (st->codecpar->channels * 2);
+ timestamp += size / (st->codecpar->channels * 2LL);
} else {
timestamp++;
}
@@ -343,7 +343,7 @@ static int mv_read_header(AVFormatContext *avctx)
avio_skip(pb, 8);
av_add_index_entry(ast, pos, timestamp, asize, 0, AVINDEX_KEYFRAME);
av_add_index_entry(vst, pos + asize, i, vsize, 0, AVINDEX_KEYFRAME);
- timestamp += asize / (ast->codecpar->channels * 2);
+ timestamp += asize / (ast->codecpar->channels * 2LL);
}
} else if (!version && avio_rb16(pb) == 3) {
avio_skip(pb, 4);