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 B80F84ACF7 for ; Sun, 19 May 2024 20:07:44 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 90FD468D06F; Sun, 19 May 2024 23:07:41 +0300 (EEST) 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 76FA968A604 for ; Sun, 19 May 2024 23:07:34 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id BBDCE1C0002 for ; Sun, 19 May 2024 20:07:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716149253; 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; bh=QjsmW4LjR9Q4rgzcohsQJbB64xxEXYdu+cNcABAG8ow=; b=AGfiazcobKMTUW+L0RD2G4dI3YdgZwTWB6q5oCoTEEWwpxOB97I+4McDXdnduJFaHREe1V 0S2ewJxiCB9POrHbQzJxeZXycivNCvoQs9REpD23nCrH+nz0gCGut4W7EtOwtLZmiCqm2W RbxHYFiWOjPHN8IWdQQZIBAC+6NvPBriB1PgfFnprRFu8VFvdIOm5HdljEBnaeGl6BjaME HLz8YAI0Cj6dno4J3QhED1BO3TKUosDySN7LAfkVLkMbm1I/4Ixhwl5gV0Q2M/Hdr61eZY zbHncX32Yx1zO9IN16BdCTZz9BmyhoBXTlfrTBtDuO8PQLApH/DDK2vzaI7idg== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 19 May 2024 22:07:31 +0200 Message-ID: <20240519200732.1951501-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/tests/jpeg2000dwt: Use 64bit in err2 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: This issue cannot happen with the current function parameters Fixes: CID1500309 Unintentional integer overflow Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/tests/jpeg2000dwt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/tests/jpeg2000dwt.c b/libavcodec/tests/jpeg2000dwt.c index 0e5a6ed9471..6148f0dacfe 100644 --- a/libavcodec/tests/jpeg2000dwt.c +++ b/libavcodec/tests/jpeg2000dwt.c @@ -57,7 +57,7 @@ static int test_dwt(int *array, int *ref, int border[2][2], int decomp_levels, i j, array[j], ref[j],decomp_levels, border[0][0], border[0][1], border[1][0], border[1][1]); return 2; } - err2 += (array[j] - ref[j]) * (array[j] - ref[j]); + err2 += (array[j] - ref[j]) * (int64_t)(array[j] - ref[j]); array[j] = ref[j]; } ff_dwt_destroy(s); -- 2.45.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".