diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-10-19 17:05:01 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-02-02 14:18:21 +0100 |
commit | 33e6737912859120e5c28307909292c3b1aa4cbe (patch) | |
tree | 99847f5939a7a539450a82828eae47489bfc7cef | |
parent | 112f5185957a1271c6125a3025e51b6476b5d1f8 (diff) | |
download | ffmpeg-33e6737912859120e5c28307909292c3b1aa4cbe.tar.gz |
avformat/genh: Check block_align
Fixes: infinite loop
Fixes: 26440/clusterfuzz-testcase-minimized-ffmpeg_dem_GENH_fuzzer-5632134020333568
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 37396e9ba85d8969a3b5e3314ab99ff604845628)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/genh.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/genh.c b/libavformat/genh.c index ed9910503d..698104a9d6 100644 --- a/libavformat/genh.c +++ b/libavformat/genh.c @@ -146,6 +146,9 @@ static int genh_read_header(AVFormatContext *s) } } + if (st->codecpar->block_align <= 0) + return AVERROR_INVALIDDATA; + avio_skip(s->pb, start_offset - avio_tell(s->pb)); avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate); |