Fixes: runtime error: signed integer overflow: 2147483598 + 128 cannot be represented in type 'int'
Fixes: 12926/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5705100733972480
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 4801eea0d465cd54670e7c19322705544e3e7524)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
... | ... |
@@ -531,7 +531,7 @@ static void dwt_decode97_int(DWTContext *s, int32_t *t) |
531 | 531 |
} |
532 | 532 |
|
533 | 533 |
for (i = 0; i < w * h; i++) |
534 |
- data[i] = (data[i] + ((1<<I_PRESHIFT)>>1)) >> I_PRESHIFT; |
|
534 |
+ data[i] = (data[i] + ((1LL<<I_PRESHIFT)>>1)) >> I_PRESHIFT; |
|
535 | 535 |
} |
536 | 536 |
|
537 | 537 |
int ff_jpeg2000_dwt_init(DWTContext *s, int border[2][2], |