1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

avformat/iff: Check data_size not overflowing int64

Fixes: Infinite loop
Fixes: 25844/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5660803318153216

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 24352ca79207d3311ee544fcba908a64004763ef)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2020-09-27 22:20:52 +02:00
parent b2a793369b
commit 6c8dd66977

View File

@ -449,6 +449,9 @@ static int iff_read_header(AVFormatContext *s)
data_size = iff->is_64bit ? avio_rb64(pb) : avio_rb32(pb);
orig_pos = avio_tell(pb);
if (data_size >= INT64_MAX)
return AVERROR_INVALIDDATA;
switch(chunk_id) {
case ID_VHDR:
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;