From patchwork Thu Sep 7 22:13:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 43647 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4e27:b0:149:dfde:5c0a with SMTP id gk39csp111489pzb; Thu, 7 Sep 2023 15:13:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGN+jQU6DM5rvNLFg01tOUnFGIdtTp9udODt9MMWph7TeA5eAZJU8HKImo+2d9UyacrcG8G X-Received: by 2002:a17:906:297:b0:9a1:db2e:9dc0 with SMTP id 23-20020a170906029700b009a1db2e9dc0mr481926ejf.44.1694124802265; Thu, 07 Sep 2023 15:13:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694124802; cv=none; d=google.com; s=arc-20160816; b=EWwvLAUHA55qidpXT4sVzVSWRMwe61f5rg7H597c1ug65KU4k7jWz2ISOp8F9bf+zp BtUP07zTygeA1HH4PEO7+f5enrmhCjyaRfrBvIQh4rQ+203dVV0573am+9KaFdHgMgE6 mEeJP34LomlEJwnwhtZLUPbBZdqr3rTqOxPO1gyPK4jmQm0snjtr90BJm5tGeYiVbWcF k74Xoq6EXTC4G0NG+TbUKk+nQGRgg0TcT6X22/xQX66WktiQyeH8Aa/G6OETJvQ3B+DR /BYmtAhhI55XXmLLV7A/iqCsFD1eI1/F+9WbpTo9D/dqmC1vUDzeq7ZNwW4sKg6f31gx H8hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to; bh=Y7mthB+y+0azPX/jqVLOeDxfPMRsHDmgj/yxeAJc9e0=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=m8OMHbuc9+mbBsLKYawbE+LkDC5hrPjNVWnNj3s8iBOyjUBCowHWLlrYO5g4YULIHI VEkz8TnnJhjjvRrnwRC1BsyFyqO5nm1/RCPphj5suBwV+0qYwV2IWPjXs44JdUl0CyZm Zpp0RRiaZYysu68IGL7fyeVr0YDqVy1MXCJPHJg7c759hf4ilKx7omU0s0UoR17f4JgF uVokeoMGmN5lpzCyLkd9wek+Z5vo0Qt9aGraiVOI1lXEQlOX2Tv0XkKcEeLxrvNkuTeK sa4uapZphbcBrc+smmsZChTuuPRi17fVI60ORuEBspAfoZc0ssYtUzClfix4I0ut3ygu d4aw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id pv1-20020a170907208100b009926007b7dasi196721ejb.126.2023.09.07.15.13.21; Thu, 07 Sep 2023 15:13:22 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DAAFA68C883; Fri, 8 Sep 2023 01:13:19 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1A97968C683 for ; Fri, 8 Sep 2023 01:13:13 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 7828E1C0002 for ; Thu, 7 Sep 2023 22:13:12 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 8 Sep 2023 00:13:11 +0200 Message-Id: <20230907221311.29742-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH] avcodec/xvididct: Fix integer overflow in idct_row() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: y9gFQzgI2pVH 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 --- libavcodec/xvididct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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];