mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02: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>
(cherry picked from commit 3c659f8618
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
5240beb4c5
commit
608be8437b
@ -2044,6 +2044,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