aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-01-15 19:03:48 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-01-31 23:47:15 +0100
commit0036b62c99116ff5b08a78e977a663d21a7aa645 (patch)
treea2b4bd13eb3aeff267eec40d24194fd7ddc3244c
parentb51f1f5a1911b607e377d442cb9cbd74eb8d646a (diff)
downloadffmpeg-0036b62c99116ff5b08a78e977a663d21a7aa645.tar.gz
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 725353525e73bbe5b6b4d01528252675f2417a02) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/ulti.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/ulti.c b/libavcodec/ulti.c
index e6f4374981..9e4c088b10 100644
--- a/libavcodec/ulti.c
+++ b/libavcodec/ulti.c
@@ -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;