[FFmpeg-cvslog] avcodec/jpeg2000dec: clear pointer which become stale in get_ppt()
Michael Niedermayer
git at videolan.org
Tue Jun 2 01:23:25 EEST 2020
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun May 31 12:49:50 2020 +0200| [4b2248594c7faf1530c43e662c4b80655240b269] | committer: 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/ffmpeg
Reviewed-by: Gautam Ramakrishnan <gautamramk at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4b2248594c7faf1530c43e662c4b80655240b269
---
libavcodec/jpeg2000dec.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 65555424ed..b7766459c4 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -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;
More information about the ffmpeg-cvslog
mailing list