aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/iff.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-12-11 00:49:23 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-09 22:02:20 +0200
commita9fe6abe0a1c86717c1b80df00af458d2d6e97d4 (patch)
treee93edb9e03fb37b244779fed37d7634dfe515ae1 /libavformat/iff.c
parentfe15426edda12b6d8345460f8f7d4be447e84387 (diff)
downloadffmpeg-a9fe6abe0a1c86717c1b80df00af458d2d6e97d4.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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/iff.c b/libavformat/iff.c
index 5024182a02..03d62fdafc 100644
--- a/libavformat/iff.c
+++ b/libavformat/iff.c
@@ -367,7 +367,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) {