1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/xvididct: Fix integer overflow in idct_row()

Fixes: signed integer overflow: 1871429831 + 343006811 cannot be represented in type 'int'
Fixes: 61784/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AIC_fuzzer-5372151001120768

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2023-09-08 00:13:11 +02:00
parent 6580a7b2b2
commit b12444fe72
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -114,7 +114,7 @@ static int idct_row(short *in, const int *const tab, int rnd)
in[5] = a1; in[5] = a1;
in[6] = a1; in[6] = a1;
} else { } else {
const int k = c4 * in[0] + rnd; const unsigned int k = c4 * in[0] + rnd;
const unsigned int a0 = k + c2 * in[2] + c4 * in[4] + c6 * in[6]; const unsigned int a0 = k + c2 * in[2] + c4 * in[4] + c6 * in[6];
const unsigned int a1 = k + c6 * in[2] - c4 * in[4] - c2 * in[6]; const unsigned int a1 = k + c6 * in[2] - c4 * in[4] - c2 * in[6];
const unsigned int a2 = k - c6 * in[2] - c4 * in[4] + c2 * in[6]; const unsigned int a2 = k - c6 * in[2] - c4 * in[4] + c2 * in[6];