From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 66DB1467DF for ; Sun, 18 Jun 2023 22:40:06 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C982B68BEFF; Mon, 19 Jun 2023 01:40:03 +0300 (EEST) Received: from mail-01-1.mymagenta.at (mail-01-1.mymagenta.at [80.109.253.246]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 172A26881DA for ; Mon, 19 Jun 2023 01:39:58 +0300 (EEST) Received: from [192.168.232.135] (helo=ren-mail-psmtp-mg01.) by mail-01.mymagenta.at with esmtp (Exim 4.93) (envelope-from ) id 1qB0Hv-00CHbK-3I for ffmpeg-devel@ffmpeg.org; Sun, 18 Jun 2023 23:50:23 +0200 Received: from localhost ([84.115.40.24]) by ren-mail-psmtp-mg01. with ESMTP id B0Huq7GTgOG5ZB0HuqOLzd; Sun, 18 Jun 2023 23:50:22 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 84.115.40.24 X-CNFS-Analysis: v=2.4 cv=KJo5sHJo c=1 sm=1 tr=0 ts=648f7c1e a=4thelYDX6rwh+ygQwvsI+Q==:117 a=4thelYDX6rwh+ygQwvsI+Q==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=NEAV23lmAAAA:8 a=U3Fd5CXeQhZsrfIc9mEA:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 18 Jun 2023 23:50:20 +0200 Message-Id: <20230618215021.3044-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230618215021.3044-1-michael@niedermayer.cc> References: <20230618215021.3044-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4xfM0syu6130o6OBi+Q97Jnchp9pUJG+oL6dSKJV9x8iYpfV4qBIuzAgt9RdqE33XAlk6fc4Mo/9V+sjvcOGxl/6t6t0ONYBOzxBz9bxYDeRarHLszObTZ WWbTY3+ModZ8uHVK/jCzSgvoO2UuDGVomZcAd5Q7oTKeMxRBjQHYoxov3av0+W7MIouhb8ZqBta4iw== Subject: [FFmpeg-devel] [PATCH 5/6] avcodec/vmixdec: Fix several integer anomalies X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Fixes: vmixdec.c:132:34: runtime error: signed integer overflow: -2147483648 * 1856 cannot be represented in type 'int' Fixes: vmixdec.c:119:20: runtime error: signed integer overflow: -1256 + -2147483648 cannot be represented in type 'int' Fixes: vmixdec.c:137:36: runtime error: signed integer overflow: 2147483416 * 16 cannot be represented in type 'int' Fixes: 59843/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VMIX_fuzzer-4857434624360448 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/vmixdec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/vmixdec.c b/libavcodec/vmixdec.c index d0f2219a67..dac0827df2 100644 --- a/libavcodec/vmixdec.c +++ b/libavcodec/vmixdec.c @@ -116,7 +116,7 @@ static int decode_dcac(AVCodecContext *avctx, dc_run--; } else { dc_v = get_se_golomb_vmix(dc_gb); - dc += dc_v; + dc += (unsigned)dc_v; if (!dc_v) dc_run = get_ue_golomb_long(dc_gb); } @@ -129,12 +129,12 @@ static int decode_dcac(AVCodecContext *avctx, ac_v = get_se_golomb_vmix(ac_gb); i = scan[n]; - block[i] = (ac_v * factors[i]) >> 4; + block[i] = (unsigned)(ac_v * factors[i]) >> 4; if (!ac_v) ac_run = get_ue_golomb_long(ac_gb); } - block[0] = ((dc + add) * 16) >> 4; + block[0] = dc + add; s->idsp.idct_put(dst + x, linesize, block); } -- 2.17.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".