Browse Source

avcodec/fmvc: Check nb_blocks

Fixes: out of array read
Fixes: 1508/clusterfuzz-testcase-minimized-5011336327069696

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0158b405a7)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.3.1
Michael Niedermayer 8 years ago
parent
commit
d2108de6b8
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      libavcodec/fmvc.c

+ 3
- 0
libavcodec/fmvc.c View File

@@ -561,6 +561,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
}

s->nb_blocks = s->xb * s->yb;
if (!s->nb_blocks)
return AVERROR_INVALIDDATA;

s->blocks = av_calloc(s->nb_blocks, sizeof(*s->blocks));
if (!s->blocks)
return AVERROR(ENOMEM);


Loading…
Cancel
Save