avcodec/ulti: Check number of blocks at init
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 15 Jan 2018 18:03:48 +0000 (19:03 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 20 Jan 2018 20:32:04 +0000 (21:32 +0100)
Fixes: Timeout
Fixes: 4832/clusterfuzz-testcase-4699096590843904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/ulti.c

index e6f4374..9e4c088 100644 (file)
@@ -50,6 +50,8 @@ static av_cold int ulti_decode_init(AVCodecContext *avctx)
     s->width = avctx->width;
     s->height = avctx->height;
     s->blocks = (s->width / 8) * (s->height / 8);
+    if (s->blocks == 0)
+        return AVERROR_INVALIDDATA;
     avctx->pix_fmt = AV_PIX_FMT_YUV410P;
     s->ulti_codebook = ulti_codebook;