aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/anm.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-08-15 21:00:54 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-08-18 22:12:55 +0200
commit1965161ef6d2aac8d3b034570c3da69dabca9e71 (patch)
treef283b8d0500e7974ce1a54be73fe510a2f60aca9 /libavcodec/anm.c
parentcff309097a3af4f7f2acb5b5f9fb914ba9ae45c3 (diff)
downloadffmpeg-1965161ef6d2aac8d3b034570c3da69dabca9e71.tar.gz
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>
Diffstat (limited to 'libavcodec/anm.c')
-rw-r--r--libavcodec/anm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/anm.c b/libavcodec/anm.c
index ab6a3994e9..778f38413e 100644
--- a/libavcodec/anm.c
+++ b/libavcodec/anm.c
@@ -119,6 +119,9 @@ static int decode_frame(AVCodecContext *avctx,
uint8_t *dst, *dst_end;
int count, ret;
+ if (buf_size < 7)
+ return AVERROR_INVALIDDATA;
+
if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
return ret;
dst = s->frame->data[0];