Commit 7ccb5761 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/xvididct: Fix integer overflow in MULT()

Fixes: signed integer overflow: 23170 * 95058 cannot be represented in type 'int'
Fixes: 20295/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEG_fuzzer-5800212870463488

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 187161d6
......@@ -142,7 +142,7 @@ static int idct_row(short *in, const int *const tab, int rnd)
#define TAN3 0xAB0E
#define SQRT2 0x5A82
#define MULT(c, x, n) (((c) * (x)) >> (n))
#define MULT(c, x, n) ((unsigned)((int)((c) * (unsigned)(x)) >> (n)))
// 12b version => #define MULT(c,x, n) ((((c) >> 3) * (x)) >> ((n) - 3))
// 12b zero-testing version:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment