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 A9AFD44CFA for ; Tue, 15 Nov 2022 22:18:31 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5686A68BD68; Wed, 16 Nov 2022 00:18:29 +0200 (EET) Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5044A68BBB1 for ; Wed, 16 Nov 2022 00:18:23 +0200 (EET) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id A8563100004 for ; Tue, 15 Nov 2022 22:18:22 +0000 (UTC) Date: Tue, 15 Nov 2022 23:18:21 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20221115221821.GD1783292@pb2> References: <20221115193022.2362787-1-jdorfman@google.com> MIME-Version: 1.0 In-Reply-To: <20221115193022.2362787-1-jdorfman@google.com> Subject: Re: [FFmpeg-devel] [PATCH] swscale/input: Use unsigned intermediates in rgb64ToUV_c_template 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="===============5534439025823888357==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============5534439025823888357== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="HWvPVVuAAfuRc6SZ" Content-Disposition: inline --HWvPVVuAAfuRc6SZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 15, 2022 at 02:30:23PM -0500, Jeremy Dorfman wrote: > Large rgb2yuv tables and high pixel values cause the intermediate > int32_t of ru*r + gu*g + bu*b to exceed INT_MAX, which is undefined > behavior. This causes libswscale built with LLVM -fsanitize=3Dundefined to > assert. Using unsigned integers instead has defined behavior and > produces identical results, and makes rgb64ToUV_c_template match > rgb64ToY_c_template. >=20 > Fixes: signed integer overflow > --- > libswscale/input.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) There are more cases which should be affected by this too. I sent a more complete patchset thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Observe your enemies, for they first find out your faults. -- Antisthenes --HWvPVVuAAfuRc6SZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iFwEABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCY3QQJwAKCRBhHseHBAsP q362AJdAOS+Q0P7ajfuK0M2M1RWrpTnfAJ91boOOoUYFSF1B/qPgcJK6jUUMLw== =09ZP -----END PGP SIGNATURE----- --HWvPVVuAAfuRc6SZ-- --===============5534439025823888357== 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". --===============5534439025823888357==--