From d897f82cf8f39cdb770ab433b018ebd840bb2237 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 5 Sep 2023 02:17:40 +0200 Subject: [PATCH] avcodec/vmixdec: Fix signed integer overflow in dc Fixes: signed integer overflow: 2147483181 + 1024 cannot be represented in type 'int' Fixes: 61117/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VMIX_fuzzer-5387692433866752 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/vmixdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vmixdec.c b/libavcodec/vmixdec.c index 962ab8339b..d6b6e3557f 100644 --- a/libavcodec/vmixdec.c +++ b/libavcodec/vmixdec.c @@ -148,7 +148,7 @@ static int decode_dcac(AVCodecContext *avctx, ac_run = get_ue_golomb_long(ac_gb); } - block[0] = (dc << lshift) + add; + block[0] = ((unsigned)dc << lshift) + (unsigned)add; s->idsp.idct_put(dst + x, linesize, block); }