avcodec/ulti: Check number of blocks at init

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>
This commit is contained in:
Michael Niedermayer 2018-01-15 19:03:48 +01:00
parent ef5994e09d
commit 725353525e

View 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;