Browse code

avcodec/hq_hqadsp: Fix runtime error: signed integer overflow: 80359 * 30274 cannot be represented in type 'int'

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>

Michael Niedermayer authored on 2017/05/13 08:12:35
Showing 1 changed files
... ...
@@ -30,7 +30,7 @@
30 30
 #define FIX_1_414 23170
31 31
 #define FIX_2_613 21407 // divided by two to fit the range
32 32
 
33
-#define IDCTMUL(a, b) ((a) * (b) >> 16)
33
+#define IDCTMUL(a, b) ((int)((a) * (unsigned)(b)) >> 16)
34 34
 
35 35
 static inline void idct_row(int16_t *blk)
36 36
 {