[FFmpeg-devel] [PATCH 1/8] avcodec/cinepak: Require 1 bit per 4x4 block as minimum input
Michael Niedermayer
michael at niedermayer.cc
Mon Aug 12 22:17:01 EEST 2019
Fixes: Timeout (12sec -> 32ms)
Fixes: 16078/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CINEPAK_fuzzer-5695832885559296
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
libavcodec/cinepak.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c
index aeb15de0ed..62eb794332 100644
--- a/libavcodec/cinepak.c
+++ b/libavcodec/cinepak.c
@@ -356,6 +356,9 @@ static int cinepak_predecode_check (CinepakContext *s)
if (s->size < 10 + s->sega_film_skip_bytes + num_strips * 12)
return AVERROR_INVALIDDATA;
+ if (s->size < (s->avctx->width * s->avctx->height) / (4*4*8))
+ return AVERROR_INVALIDDATA;
+
if (num_strips) {
const uint8_t *data = s->data + 10 + s->sega_film_skip_bytes;
int strip_size = AV_RB24 (data + 1);
--
2.22.0
More information about the ffmpeg-devel
mailing list