Browse Source

avformat/bintext: Check width in idf_read_header()

Fixes: division by 0
Fixes: 26802/clusterfuzz-testcase-minimized-ffmpeg_dem_IDF_fuzzer-5180591554953216.fuzz

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
442d53f409
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavformat/bintext.c

+ 2
- 0
libavformat/bintext.c View File

@@ -344,6 +344,8 @@ static int idf_read_header(AVFormatContext *s)

bin->fsize = avio_size(pb) - 12 - 4096 - 48;
ff_sauce_read(s, &bin->fsize, &got_width, 0);
if (st->codecpar->width < 8)
return AVERROR_INVALIDDATA;
if (!bin->width)
calculate_height(st->codecpar, bin->fsize);
avio_seek(pb, 12, SEEK_SET);


Loading…
Cancel
Save