avcodec/vp3dsp: Fix multiple signed integer overflow: 46341 * 47523 cannot be represe...
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 24 Feb 2017 12:11:43 +0000 (13:11 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 24 Feb 2017 13:12:13 +0000 (14:12 +0100)
Fixes: 664/clusterfuzz-testcase-4917047475568640

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

index 814c78e..4b6c838 100644 (file)
@@ -41,7 +41,7 @@
 #define xC6S2 25080
 #define xC7S1 12785
 
-#define M(a, b) (((a) * (b)) >> 16)
+#define M(a, b) ((int)((SUINT)(a) * (b)) >> 16)
 
 static av_always_inline void idct(uint8_t *dst, int stride,
                                   int16_t *input, int type)