aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-10-27 23:26:52 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2019-12-31 19:51:56 +0100
commit6be30c4f8efacfda07ff318ee406fae14ae6dea0 (patch)
treee76915ad2317051e8c513b374270db3fb45d253c
parent8f71cd980c5a9244a5c5b2186cbc1fac40876ac7 (diff)
downloadffmpeg-6be30c4f8efacfda07ff318ee406fae14ae6dea0.tar.gz
avcodec/apedec: Only clear the needed buffer space, instead of all
Fixes: Timeout (15sec -> 0.4sec) Fixes: 18396/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5730080487112704 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit f17ea0200178a4dae446a6bec2f68312f41714a0) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/apedec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 9f1e8123b7..9409a4727d 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -1500,7 +1500,7 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
av_fast_malloc(&s->decoded_buffer, &s->decoded_size, decoded_buffer_size);
if (!s->decoded_buffer)
return AVERROR(ENOMEM);
- memset(s->decoded_buffer, 0, s->decoded_size);
+ memset(s->decoded_buffer, 0, decoded_buffer_size);
s->decoded[0] = s->decoded_buffer;
s->decoded[1] = s->decoded_buffer + FFALIGN(blockstodecode, 8);