mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-08-09 09:32:43 +00:00
avcodec/jpeg2000dec: avoid signed overflow in ROI shift
Fixes: 522402419/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_DEC_fuzzer-5987463315914752
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 90a285ca78)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -2104,7 +2104,7 @@ static int decode_cblk(const Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *cod
|
||||
val &= INT32_MAX;
|
||||
/* ROI shift, if necessary */
|
||||
if (roi_shift && (((uint32_t)val & ~mask) == 0))
|
||||
val <<= roi_shift;
|
||||
val = (uint32_t)val << roi_shift;
|
||||
t1->data[n] = val | sign; /* NOTE: Binary point for reconstruction value is located in 31 - M_b */
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user