mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-29 02:42:21 +00:00
avcodec/jpeg2000dec: Check that atom header is within bytsetream
Fixes: Infinite loop Fixes: 36666/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5912760671141888 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
33feb527ff
commit
3c659f8618
@ -2360,6 +2360,8 @@ static int jp2_find_codestream(Jpeg2000DecoderContext *s)
|
||||
atom_size >= 16) {
|
||||
uint32_t atom2_size, atom2, atom2_end;
|
||||
do {
|
||||
if (bytestream2_get_bytes_left(&s->g) < 8)
|
||||
break;
|
||||
atom2_size = bytestream2_get_be32u(&s->g);
|
||||
atom2 = bytestream2_get_be32u(&s->g);
|
||||
atom2_end = bytestream2_tell(&s->g) + atom2_size - 8;
|
||||
|
Loading…
Reference in New Issue
Block a user