avcodec/svq3: Fix runtime error: signed integer overflow: 169 * 12717677 cannot be...
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 13 May 2017 21:16:44 +0000 (23:16 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 13 May 2017 21:17:18 +0000 (23:17 +0200)
Fixes: 1556/clusterfuzz-testcase-minimized-5027865978470400

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

index c9d4160..4814b80 100644 (file)
@@ -263,7 +263,7 @@ static void svq3_add_idct_c(uint8_t *dst, int16_t *block,
     int i;
 
     if (dc) {
-        dc       = 13 * 13 * (dc == 1 ? 1538 * block[0]
+        dc       = 13 * 13 * (dc == 1 ? 1538U* block[0]
                                       : qmul * (block[0] >> 3) / 2);
         block[0] = 0;
     }