Commit 4b224859 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/jpeg2000dec: clear pointer which become stale in get_ppt()

Fixes: use after free
Fixes: 22484/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5671488765296640

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegReviewed-by: 's avatarGautam Ramakrishnan <gautamramk@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 01fd93e2
......@@ -928,6 +928,7 @@ static int get_ppt(Jpeg2000DecoderContext *s, int n)
tile->packed_headers = new;
} else
return AVERROR(ENOMEM);
memset(&tile->packed_headers_stream, 0, sizeof(tile->packed_headers_stream));
memcpy(tile->packed_headers + tile->packed_headers_size,
s->g.buffer, n - 3);
tile->packed_headers_size += n - 3;
......
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