diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-10-31 13:51:47 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-11-11 17:05:24 +0100 |
commit | f6dc285fb5f30406b275b968ee438a738da799d1 (patch) | |
tree | 03f52a4383064f126e487f91dd7fe85492848d1d | |
parent | 9ef60a66f1f155605049402415bd901c8baf1a24 (diff) | |
download | ffmpeg-f6dc285fb5f30406b275b968ee438a738da799d1.tar.gz |
avformat/bintext: Check width
Fixes: division by 0
Fixes: 26780/clusterfuzz-testcase-minimized-ffmpeg_dem_ADF_fuzzer-5117945027756032
Fixes: 26998/clusterfuzz-testcase-minimized-ffmpeg_dem_ADF_fuzzer-5119352359354368
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/bintext.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/bintext.c b/libavformat/bintext.c index 144b4172af..bc0f6bd099 100644 --- a/libavformat/bintext.c +++ b/libavformat/bintext.c @@ -293,6 +293,8 @@ static int adf_read_header(AVFormatContext *s) bin->fsize = avio_size(pb) - 1 - 192 - 4096; st->codecpar->width = 80<<3; 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, 1 + 192 + 4096, SEEK_SET); |