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>
(cherry picked from commit 725353525e
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@ -50,6 +50,8 @@ static av_cold int ulti_decode_init(AVCodecContext *avctx)
|
|||||||
s->width = avctx->width;
|
s->width = avctx->width;
|
||||||
s->height = avctx->height;
|
s->height = avctx->height;
|
||||||
s->blocks = (s->width / 8) * (s->height / 8);
|
s->blocks = (s->width / 8) * (s->height / 8);
|
||||||
|
if (s->blocks == 0)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
avctx->pix_fmt = AV_PIX_FMT_YUV410P;
|
avctx->pix_fmt = AV_PIX_FMT_YUV410P;
|
||||||
s->ulti_codebook = ulti_codebook;
|
s->ulti_codebook = ulti_codebook;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user