avcodec/jpeg2000dwt: Fix runtime error: left shift of negative value -123
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 11 Jun 2017 18:28:46 +0000 (20:28 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 11 Jun 2017 18:52:47 +0000 (20:52 +0200)
Fixes: 2208/clusterfuzz-testcase-minimized-5976593765761024

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/jpeg2000dwt.c

index 188cc26..735ed0b 100644 (file)
@@ -488,7 +488,7 @@ static void dwt_decode97_int(DWTContext *s, int32_t *t)
     line += 5;
 
     for (i = 0; i < w * h; i++)
-        data[i] <<= I_PRESHIFT;
+        data[i] *= 1 << I_PRESHIFT;
 
     for (lev = 0; lev < s->ndeclevels; lev++) {
         int lh = s->linelen[lev][0],