aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-10-31 13:51:47 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-17 21:34:53 +0200
commit57d6ff94f00cb0359098cacc138c9fb04a1d8af2 (patch)
tree6537756826a8567046a834ece78455aff5367f66
parent9903bf3b06ba22cfcf9fdcc7d8e859c0b90108de (diff)
downloadffmpeg-57d6ff94f00cb0359098cacc138c9fb04a1d8af2.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> (cherry picked from commit f6dc285fb5f30406b275b968ee438a738da799d1) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/bintext.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/bintext.c b/libavformat/bintext.c
index 217ea49247..e339fef35f 100644
--- a/libavformat/bintext.c
+++ b/libavformat/bintext.c
@@ -242,6 +242,8 @@ static int adf_read_header(AVFormatContext *s)
bin->fsize = avio_size(pb) - 1 - 192 - 4096;
st->codec->width = 80<<3;
ff_sauce_read(s, &bin->fsize, &got_width, 0);
+ if (st->codec->width < 8)
+ return AVERROR_INVALIDDATA;
if (!bin->width)
calculate_height(st->codec, bin->fsize);
avio_seek(pb, 1 + 192 + 4096, SEEK_SET);