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 C70B64B5EC for ; Tue, 9 Jul 2024 12:44:25 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3AE3368DCA0; Tue, 9 Jul 2024 15:44:22 +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 D717E68D932 for ; Tue, 9 Jul 2024 15:44:15 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 3CE8FFF80A for ; Tue, 9 Jul 2024 12:44:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1720529055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Iw55ks1ViK7DnogAg4vqrt4Sx0waBEiVKkfuRurrEPo=; b=HzOAcUUUvRkMkr0sPxAxW851zjycGDXH1/PbK5Njkj8rU/h/7k/HpCqQvPkiqcW0F6ZZh9 eGAu7dIV2CsLJp7Fzu7Um3jScUZ5nEV/GhAgnjxlJVHDtDFvJcLo4zRBRDSDkTJVilE2Ap PGHMQsJ4oQlV48d7fDtmsKW/2L5NWfZc+9AIC62UKPv2FX/6R2F2rP/d6ldaNbNQwR/ogb Yj1en4Qn9o+BlndXbXdLDThyIZYIBTILKzMP/fbBVli4I5/tJi/DIUGzBFZP+jJMx4uxjc Aum7NAYQznTv8WfBsf3nv7JYcPT3LzKShGo0v9j/tWLnXz5oGrSlaW2B92b/Gg== Date: Tue, 9 Jul 2024 14:44:14 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240709124414.GW4991@pb2> References: <20240708042517.5585-1-gseanmcg@gmail.com> MIME-Version: 1.0 In-Reply-To: <20240708042517.5585-1-gseanmcg@gmail.com> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCHv2] swscale: prevent undefined behaviour in the PUTRGBA macro 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: multipart/mixed; boundary="===============3988147472919111450==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============3988147472919111450== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="xWiEbTquLUstXc+R" Content-Disposition: inline --xWiEbTquLUstXc+R Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 08, 2024 at 12:25:17AM -0400, Sean McGovern wrote: > --- > libswscale/yuv2rgb.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c > index 977eb3a7dd..ac0b811f61 100644 > --- a/libswscale/yuv2rgb.c > +++ b/libswscale/yuv2rgb.c > @@ -100,9 +100,9 @@ const int *sws_getCoefficients(int colorspace) > =20 > #define PUTRGBA(dst, ysrc, asrc, i, abase) \ > Y =3D ysrc[2 * i]; = \ > - dst[2 * i] =3D r[Y] + g[Y] + b[Y] + (asrc[2 * i] << abase); = \ > + dst[2 * i] =3D r[Y] + g[Y] + b[Y] + ((int32_t)(asrc[2 * i]) = << abase); \ > Y =3D ysrc[2 * i + 1]; = \ > - dst[2 * i + 1] =3D r[Y] + g[Y] + b[Y] + (asrc[2 * i + 1] << abase); > + dst[2 * i + 1] =3D r[Y] + g[Y] + b[Y] + ((int32_t)(asrc[2 * i + 1]) = << abase); can you explain what undefined behavior this does prevent and how ? (in the commit message) thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The greatest way to live with honor in this world is to be what we pretend to be. -- Socrates --xWiEbTquLUstXc+R Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZo0wngAKCRBhHseHBAsP q5gBAKCBaTYSTn3sPijNBjCYFWPqHlaEqwCeLmWrsexZ/Yz329iiHYKHlKXAUQU= =Taiu -----END PGP SIGNATURE----- --xWiEbTquLUstXc+R-- --===============3988147472919111450== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============3988147472919111450==--