From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id A00594D921 for ; Thu, 3 Jul 2025 02:02:15 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id BE45568E52A; Thu, 3 Jul 2025 05:01:44 +0300 (EEST) Received: from relay15.mail.gandi.net (relay15.mail.gandi.net [217.70.178.235]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id B188A68E516 for ; Thu, 3 Jul 2025 05:01:37 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 0C25544228 for ; Thu, 3 Jul 2025 02:01:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1751508097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WhiyC9IfYOesK3kwD5juJIhRAhP4yzppwKsgJT6YHZw=; b=eRTKvbZi8X8UfpXED53pAr8U0hpDTNd4LazTGlhHnArJhPMz3KcZ12qQoikGLyNfLdB4KX tXSGHX7O88vXGh4eypMLUD61kwUfTmqrnq89cMcePoNkMKbv0YTbvCdk82vVpiBNy1Pnbo u4hcMTYWd37/JTET74PxlRGHjKtMbOHDvfm5gsp5ewNKNR88v9/zW1gayMsnP1nYhNzIo6 MsnDk1WHDAYzQYR7znP1jcYApleXmyP0mj1oiLZhaxdX9hookbBJprJjkw6UBlr8JTSQNE tXLKJx6+hvG63asd4GgS2pcc1wcBEne5A0qO2DhVNAAUJP90Hxl95epxHXnYGA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 3 Jul 2025 04:01:30 +0200 Message-ID: <20250703020131.2506428-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250703020131.2506428-1-michael@niedermayer.cc> References: <20250703020131.2506428-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-State: clean X-GND-Score: -85 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdduledtfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhlucfvnfffucdludehmdenucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofhitghhrggvlhcupfhivgguvghrmhgrhigvrhcuoehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgeqnecuggftrfgrthhtvghrnhepgeejhfetgefhgfeludegvdduvdffgeefvddtheetlefhueeitdevffevfeehhefgnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucfkphepgedurdeiiedrieeirddvvdejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepgedurdeiiedrieeirddvvdejpdhhvghloheplhhotggrlhhhohhsthdpmhgrihhlfhhrohhmpehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgdpnhgspghrtghpthhtohepuddprhgtphhtthhopehffhhmphgvghdquggvvhgvlhesfhhfmhhpvghgrdhorhhg Subject: [FFmpeg-devel] [PATCH 4/5] avcodec/apv_dsp: Avoid UB overflow in dequant 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 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: signed integer overflow: 33632416 * 64 cannot be represented in type 'int' Fixes: 421817631/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APV_fuzzer-4957386534354944 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/apv_dsp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/apv_dsp.c b/libavcodec/apv_dsp.c index 07bb34ec0bf..8fbabcf63db 100644 --- a/libavcodec/apv_dsp.c +++ b/libavcodec/apv_dsp.c @@ -58,8 +58,8 @@ static void apv_decode_transquant_c(void *output, for (int y = 0; y < 8; y++) { for (int x = 0; x < 8; x++) { - int coeff = (input[y][x] * qmatrix[y][x] * (1 << qp_shift) + - (1 << (bd_shift - 1))) >> bd_shift; + int coeff = ((int)(input[y][x] * qmatrix[y][x] * (1U << qp_shift) + + (1 << (bd_shift - 1)))) >> bd_shift; scaled_coeff[y][x] = av_clip(coeff, APV_MIN_TRANS_COEFF, -- 2.49.0 _______________________________________________ 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".