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 7D9EB4879F for ; Thu, 16 May 2024 23:20:22 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 59D9268D321; Fri, 17 May 2024 02:19:47 +0300 (EEST) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6C81668D2EB for ; Fri, 17 May 2024 02:19:38 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 9DAEB20010 for ; Thu, 16 May 2024 23:19:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1715901577; 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=etHksJlGMmKbuqxR6zFfI94KZqA6rGLkxaloBGO+a0w=; b=n9PTpJcwK20kJGx0Dpa3YX0SRwrZd8+ZLMXQKv5jVbmv+ZP8cLhNA1FqJjy2P5d9kRYDdy j05L/cwTxTBLu5s9cyNOkzns4oFQFKiLVV6toSPttg/ErWmbPZz9BB/SkQuSLU1V0AI/PV E7pAVAzTWAW+Zr1qkbaFrDhDX5I7VBfKq2suScuqn70MftuqhkOEl5CKYyTrJoyfEXSvik q8FKn8KxFArXjdDkjhuMT4B8fJUV/6iUjv2bzweX7jivk4OE3Mv2tpvbg5LhdRVGBWUktS 4G00T5bkb+wK3zdsmjJ9Fz/UQ9GxB5EIqEAtf7jc/+T3F4Rz3mgCMZi6sD+HYw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 17 May 2024 01:19:32 +0200 Message-ID: <20240516231932.6950-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240516231932.6950-1-michael@niedermayer.cc> References: <20240516231932.6950-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 5/5] avcodec/tests/dct: Use 64bit in intermediate for error computation 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: CID1500284 Unintentional integer overflow Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/tests/dct.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/tests/dct.c b/libavcodec/tests/dct.c index 010d0c1ac35..17a08144597 100644 --- a/libavcodec/tests/dct.c +++ b/libavcodec/tests/dct.c @@ -226,8 +226,8 @@ static int dct_error(const struct algo *dct, int test, int is_idct, int speed, c v = abs(err); if (v > err_inf) err_inf = v; - err2_matrix[i] += v * v; - err2 += v * v; + err2_matrix[i] += v * (int64_t)v; + err2 += v * (int64_t)v; sysErr[i] += block[i] - block1[i]; blockSumErr += v; if (abs(block[i]) > maxout) -- 2.43.2 _______________________________________________ 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".