Browse Source

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 8e4b522c91)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n2.8.16
Michael Niedermayer 6 years ago
parent
commit
cc600fe4b5
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      libavcodec/apedec.c

+ 2
- 1
libavcodec/apedec.c View File

@@ -1443,7 +1443,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) {


Loading…
Cancel
Save