diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-10-31 13:51:47 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-09-09 13:53:29 +0200 |
commit | c2221da01937dc79080a38ca75115e65af6a5623 (patch) | |
tree | 0e02dbdfe84870eff2937fe0f9acd15d39862ee8 | |
parent | 9d2df3050e6e76aeec5b6403c6dde0b2cba91170 (diff) | |
download | ffmpeg-c2221da01937dc79080a38ca75115e65af6a5623.tar.gz |
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>
(cherry picked from commit 442d53f409c8d84c7db120227caac00af54aa884)
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 0b499d9555..599e4e3e3e 100644 --- a/libavformat/bintext.c +++ b/libavformat/bintext.c @@ -340,6 +340,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); |