aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-12-18 00:31:08 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-09 13:53:29 +0200
commit2e26851dcd11b79152870dc9a2921920edf7655d (patch)
tree2c99d5ff320ef45ff8576526dca7ac787b0beff5
parent305ae7fc02b5331995a7694ceef2d818c96c7d37 (diff)
downloadffmpeg-2e26851dcd11b79152870dc9a2921920edf7655d.tar.gz
avcodec/simple_idct: Fix undefined integer overflow in idct4row()
Fixes: signed integer overflow: -1498310196 - 902891776 cannot be represented in type 'int' Fixes: 28445/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5075163389493248 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 57f7e5caa324fd760aa9e134ee963e9936083c59) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/simple_idct.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/simple_idct.c b/libavcodec/simple_idct.c
index 78b29c0fe3..a6f38abfb7 100644
--- a/libavcodec/simple_idct.c
+++ b/libavcodec/simple_idct.c
@@ -175,7 +175,8 @@ static inline void idct4col_add(uint8_t *dest, ptrdiff_t line_size, const int16_
#define R_SHIFT 11
static inline void idct4row(int16_t *row)
{
- int c0, c1, c2, c3, a0, a1, a2, a3;
+ unsigned c0, c1, c2, c3;
+ int a0, a1, a2, a3;
a0 = row[0];
a1 = row[1];