aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-08-04 08:26:40 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-01-06 11:30:42 +0100
commit1c5b4460b76c524ba65b04aa5b1412aeeceeb2c4 (patch)
tree25191bcf328c67c9107005b611b64da0052728e0
parentc1e67ca966ce7779054b79907c388e2a4a035cc8 (diff)
downloadffmpeg-1c5b4460b76c524ba65b04aa5b1412aeeceeb2c4.tar.gz
avcodec/apedec: Do not partially clear data array
Fixes: Assertion failure and memleak Fixes: 15709/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5182435093905408 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 8e4b522c9146b9c14579ae7381fb1043b7423578) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/apedec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 7a7097e7a4..1a86ac1786 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -1451,7 +1451,8 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
if (s->fileversion >= 3900) {
if (offset > 3) {
av_log(avctx, AV_LOG_ERROR, "Incorrect offset passed\n");
- s->data = NULL;
+ av_freep(&s->data);
+ s->data_size = 0;
return AVERROR_INVALIDDATA;
}
if (s->data_end - s->ptr < offset) {