aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/xvididct.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2023-09-08 00:13:11 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2023-09-22 23:47:41 +0200
commitb12444fe72173ab52b6479708cfd12cb889ca300 (patch)
tree5677eb4fffbcf76a4502728451a1f2579f0a7bca /libavcodec/xvididct.c
parent6580a7b2b27973947118482235a2eb1214d968a2 (diff)
downloadffmpeg-b12444fe72173ab52b6479708cfd12cb889ca300.tar.gz
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>
Diffstat (limited to 'libavcodec/xvididct.c')
-rw-r--r--libavcodec/xvididct.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/xvididct.c b/libavcodec/xvididct.c
index 43ea927437..dcea32210a 100644
--- a/libavcodec/xvididct.c
+++ b/libavcodec/xvididct.c
@@ -114,7 +114,7 @@ static int idct_row(short *in, const int *const tab, int rnd)
in[5] = a1;
in[6] = a1;
} 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 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];