Browse Source

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>
tags/n4.4
Michael Niedermayer 5 years ago
parent
commit
001bc594d8
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavformat/iff.c

+ 1
- 1
libavformat/iff.c View File

@@ -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) {


Loading…
Cancel
Save