aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-11-05 22:14:21 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-17 21:34:53 +0200
commit852f1ebe9c385fa8f159e203f7e1b3b30828298a (patch)
treed0e0ad88810d3518a7a8b41e753ffff2b16152a3
parent86d0295f38fbfca91107e80ec3cd6d76634f3ebd (diff)
downloadffmpeg-852f1ebe9c385fa8f159e203f7e1b3b30828298a.tar.gz
avcodec/h264idct_template: Fix integer overflow in ff_h264_chroma422_dc_dequant_idct()
Fixes: signed integer overflow: -2105540608 - 2105540608 cannot be represented in type 'int' Fixes: 26870/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-5656647567147008 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 51dfd6f1bdb03bfc7574b12e921fb3b8639ba5cf) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/h264idct_template.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/h264idct_template.c b/libavcodec/h264idct_template.c
index 85ccf326fa..d67c766f12 100644
--- a/libavcodec/h264idct_template.c
+++ b/libavcodec/h264idct_template.c
@@ -283,8 +283,8 @@ void FUNCC(ff_h264_chroma422_dc_dequant_idct)(int16_t *_block, int qmul){
dctcoef *block = (dctcoef*)_block;
for(i=0; i<4; i++){
- temp[2*i+0] = block[stride*i + xStride*0] + block[stride*i + xStride*1];
- temp[2*i+1] = block[stride*i + xStride*0] - block[stride*i + xStride*1];
+ temp[2*i+0] = block[stride*i + xStride*0] + (unsigned)block[stride*i + xStride*1];
+ temp[2*i+1] = block[stride*i + xStride*0] - (unsigned)block[stride*i + xStride*1];
}
for(i=0; i<2; i++){