mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-24 03:59:43 +00:00
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>
This commit is contained in:
parent
6965ade54c
commit
a413ed9863
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user