diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-12-11 00:49:23 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-02-02 14:18:21 +0100 |
commit | 3e83476a6e840b4a15bd8fe4f311fbe34dca0436 (patch) | |
tree | 980b373ef9f5d6c9ca486f4a6962f14433443254 /libavformat/iff.c | |
parent | 9a032dfd5f837cfeb82cbc72c797aba3a952d614 (diff) | |
download | ffmpeg-3e83476a6e840b4a15bd8fe4f311fbe34dca0436.tar.gz |
avformat/iff: Check data_size
Fixes: infinite loop
Fixes: 27834/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-5694930919620608
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 001bc594d82f3df67a6e96c6ea022f4e39002385)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/iff.c')
-rw-r--r-- | libavformat/iff.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/iff.c b/libavformat/iff.c index f017684620..2dba121f6f 100644 --- a/libavformat/iff.c +++ b/libavformat/iff.c @@ -368,7 +368,7 @@ static int read_dst_frame(AVFormatContext *s, AVPacket *pkt) data_size = iff->is_64bit ? avio_rb64(pb) : avio_rb32(pb); data_pos = avio_tell(pb); - if (data_size < 1) + if (data_size < 1 || data_size >= INT64_MAX) return AVERROR_INVALIDDATA; switch (chunk_id) { |