diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-10-19 17:39:30 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-02-02 14:18:21 +0100 |
commit | 112f5185957a1271c6125a3025e51b6476b5d1f8 (patch) | |
tree | 31de0a3a9f36c3f1ae162802d379e2db7b89fd61 | |
parent | 5e880774dcb32e4c5241d77f3c187ee483f1dbba (diff) | |
download | ffmpeg-112f5185957a1271c6125a3025e51b6476b5d1f8.tar.gz |
avformat/mvi: Check count for overflow
Fixes: left shift of 21378748 by 10 places cannot be represented in type 'int'
Fixes: 26449/clusterfuzz-testcase-minimized-ffmpeg_dem_MVI_fuzzer-5680463374712832
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 a413ed98632127342ad04b26e0ba0dc26adb70c9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/mvi.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mvi.c b/libavformat/mvi.c index ff5c08bf51..06c9cfe3f0 100644 --- a/libavformat/mvi.c +++ b/libavformat/mvi.c @@ -123,6 +123,8 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) count = (mvi->audio_size_counter + mvi->audio_frame_size + 512) >> MVI_FRAC_BITS; if (count > mvi->audio_size_left) count = mvi->audio_size_left; + if ((int64_t)count << MVI_FRAC_BITS > INT_MAX) + return AVERROR_INVALIDDATA; if ((ret = av_get_packet(pb, pkt, count)) < 0) return ret; pkt->stream_index = MVI_AUDIO_STREAM_INDEX; |