aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/genh.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-10-19 17:05:01 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-10-24 19:11:12 +0200
commit37396e9ba85d8969a3b5e3314ab99ff604845628 (patch)
tree39dc55943dec468b717eeeb1c49c2665eb8e5c18 /libavformat/genh.c
parenta413ed98632127342ad04b26e0ba0dc26adb70c9 (diff)
downloadffmpeg-37396e9ba85d8969a3b5e3314ab99ff604845628.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>
Diffstat (limited to 'libavformat/genh.c')
-rw-r--r--libavformat/genh.c3
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);