summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2020-10-31 13:51:47 +0100
committerMichael Niedermayer <[email protected]>2021-02-02 14:18:21 +0100
commit14e4f69fbae70048dfacb48d2bd3a7837a55242a (patch)
tree0bca78e729c5d2f4141fd7d345a2f81a6f383f6b
parent4a6325c69ca2200f02ab7d0b4efaa8df46c60f9e (diff)
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 <[email protected]> (cherry picked from commit 442d53f409c8d84c7db120227caac00af54aa884) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavformat/bintext.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/bintext.c b/libavformat/bintext.c
index 7dab5f377d..144b4172af 100644
--- a/libavformat/bintext.c
+++ b/libavformat/bintext.c
@@ -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);