diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-05-04 19:11:36 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-05-06 21:02:04 +0200 |
commit | a96c131eb53b00de154f4773d96a3b323ea3daed (patch) | |
tree | 48062a3cd79558821db7b01b2df531f2e04a01da /libavcodec/jpeg2000dec.c | |
parent | 3543522d200f46a9a2782b95c83c031626fd7a04 (diff) | |
download | ffmpeg-a96c131eb53b00de154f4773d96a3b323ea3daed.tar.gz |
avcodec/jpeg2000dec: Skip init for component in CPRL if nothing is to be done
Fixes: assertion failure
Fixes: 7949/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-4819602782552064
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/jpeg2000dec.c')
-rw-r--r-- | libavcodec/jpeg2000dec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index 6aa63a9771..5aa0713ed6 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -1159,6 +1159,9 @@ static int jpeg2000_decode_packets_po_iteration(Jpeg2000DecoderContext *s, Jpeg2 step_x = 32; step_y = 32; + if (RSpoc > FFMIN(codsty->nreslevels, REpoc)) + continue; + for (reslevelno = RSpoc; reslevelno < FFMIN(codsty->nreslevels, REpoc); reslevelno++) { uint8_t reducedresno = codsty->nreslevels - 1 -reslevelno; // ==> N_L - r Jpeg2000ResLevel *rlevel = comp->reslevel + reslevelno; |