diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-13 02:22:27 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-13 02:23:23 +0300 |
commit | 0158b405a71f386c7844a3d975315afd47f16b5d (patch) | |
tree | d4159873bfdacde3b6991f91b2ee57dba468d304 /libavcodec/fmvc.c | |
parent | e66488252335d3e7870c72d1ac7040e8c1853f07 (diff) |
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>
Diffstat (limited to 'libavcodec/fmvc.c')
-rw-r--r-- | libavcodec/fmvc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/fmvc.c b/libavcodec/fmvc.c index 1f8b0c5c17..ff5f291da6 100644 --- a/libavcodec/fmvc.c +++ b/libavcodec/fmvc.c @@ -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); |