diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-08-15 21:00:54 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-07-01 12:11:55 +0200 |
commit | 225b14427729e76714955dc3e4c04814b4add364 (patch) | |
tree | 0a59ebc1663f042481eccf0a60c0fd2b7705b5de | |
parent | adfd49ee987817a485433b26416abfb1233b1b5d (diff) | |
download | ffmpeg-225b14427729e76714955dc3e4c04814b4add364.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>
(cherry picked from commit 1965161ef6d2aac8d3b034570c3da69dabca9e71)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/anm.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/anm.c b/libavcodec/anm.c index 29d59fbceb..c3b3ecc62a 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]; |