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 06E104AD52 for ; Tue, 21 May 2024 02:47:41 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F294168D2D4; Tue, 21 May 2024 05:47:07 +0300 (EEST) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CA30C68D2A4 for ; Tue, 21 May 2024 05:46:59 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 03919FF803 for ; Tue, 21 May 2024 02:46:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716259619; 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=ZHWliFpK6DPg6xBdiS+q7lLiwhLwSf8g0sRzNISRW/Y=; b=mcBsJ1nsEaz5vbd9kEJf5wwtJDvMwm52b1sr7Ee9MRh6L+Mr6k53jR1wVkDp/q03UYeA+U yBWVvEgzYBOa/VnDnwG3nao/PgwaBw1jvn+lstLZmo4NnDGWRqWjVaAcyxrIOFkTOKL2Lo k4qHAjCKcd3IuWLMm+4qu+BKMZe+iLHneLkGvmw5kVKthIqHCu/v+rUSWWnjvk/vXpo6Bv hG79AZGSwak1oBik2MSvaEp2qqk8fspofuxllnKTbqKY4orJyP4FUdeyvApcSnVcP71Kcy +bCP7dAfmIYHSqxFScmLJ2tHc/xgLjZVPItOlf4u/sRO+XJDDSBX+Rp9a3VzYA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 21 May 2024 04:46:50 +0200 Message-ID: <20240521024652.1006233-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240521024652.1006233-1-michael@niedermayer.cc> References: <20240521024652.1006233-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 5/7] swscale/yuv2rgb: Use 64bit for brightness 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 will not overflow for normal values Fixes: CID1500280 Unintentional integer overflow Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libswscale/yuv2rgb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c index 2b2358d2cc1..c1d6236f37f 100644 --- a/libswscale/yuv2rgb.c +++ b/libswscale/yuv2rgb.c @@ -830,7 +830,7 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], cbu = (cbu * contrast * saturation) >> 32; cgu = (cgu * contrast * saturation) >> 32; cgv = (cgv * contrast * saturation) >> 32; - oy -= 256 * brightness; + oy -= 256LL * brightness; c->uOffset = 0x0400040004000400LL; c->vOffset = 0x0400040004000400LL; -- 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".