Commit 8e4b522c authored by Michael Niedermayer's avatar Michael Niedermayer

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/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 208225bd
...@@ -1451,7 +1451,8 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data, ...@@ -1451,7 +1451,8 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
if (s->fileversion >= 3900) { if (s->fileversion >= 3900) {
if (offset > 3) { if (offset > 3) {
av_log(avctx, AV_LOG_ERROR, "Incorrect offset passed\n"); av_log(avctx, AV_LOG_ERROR, "Incorrect offset passed\n");
s->data = NULL; av_freep(&s->data);
s->data_size = 0;
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
if (s->data_end - s->ptr < offset) { if (s->data_end - s->ptr < offset) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment