avcodec/hq_hqadsp: Fix runtime error: signed integer overflow: 80359 * 30274 cannot...
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 12 May 2017 23:12:35 +0000 (01:12 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 12 May 2017 23:15:29 +0000 (01:15 +0200)
Fixes: 1507/clusterfuzz-testcase-minimized-4955228300378112

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

index db1ea2e..1b9f138 100644 (file)
@@ -30,7 +30,7 @@
 #define FIX_1_414 23170
 #define FIX_2_613 21407 // divided by two to fit the range
 
-#define IDCTMUL(a, b) ((a) * (b) >> 16)
+#define IDCTMUL(a, b) ((int)((a) * (unsigned)(b)) >> 16)
 
 static inline void idct_row(int16_t *blk)
 {