Browse Source

avcodec/anm: Check input size for a frame with just a stop code

Fixes: Timeout (11sec -> 6sec)
Fixes: 16344/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ANM_fuzzer-5673032000995328

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1965161ef6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.1.5
Michael Niedermayer 6 years ago
parent
commit
e31e1d75d1
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      libavcodec/anm.c

+ 3
- 0
libavcodec/anm.c View File

@@ -119,6 +119,9 @@ static int decode_frame(AVCodecContext *avctx,
uint8_t *dst, *dst_end; uint8_t *dst, *dst_end;
int count, ret; int count, ret;


if (buf_size < 7)
return AVERROR_INVALIDDATA;

if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
return ret; return ret;
dst = s->frame->data[0]; dst = s->frame->data[0];


Loading…
Cancel
Save