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 47D974AB53 for ; Fri, 12 Jul 2024 20:01:30 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0538968DBBE; Fri, 12 Jul 2024 23:01:29 +0300 (EEST) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C16EE68D81C for ; Fri, 12 Jul 2024 23:01:22 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 3497C240005 for ; Fri, 12 Jul 2024 20:01:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1720814482; 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=S5fhmih9hasrJMOB/oPRZuOhFKUf4sHYQcIUBYzySW0=; b=f1Zx6y7xcai26/Po9o4uZmf2nkS+gvd9pGQS6jW94qSAloCdcBkO3jg6er15WBJ2XW5JZQ TTeNH/NL6brD9kk6ZOgV1BAPVO1xn2wwTitQ7i//CQ8r8jCBq33SiFRtefNwAP9P7p+Wl5 qqmMrlf/VWWNITBt9MBiWNuIAqN2HFHPAqmdlzPsW2eX5/G0ApHPhQ1cJuZggMRHKHDiVc PrSqSQfH4TqiZuIyB+L0pkJ8zi8QJSalnRADSojksILsGb4pyf1dct0qFZjfSYqZk14BaQ ExwCwA23Vz5S8l3AnfdLChth778Umn6/tdlYIQZn88R6dARUw+p0LtjPk+mEpQ== Date: Fri, 12 Jul 2024 22:01:21 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240712200121.GS4991@pb2> References: <20240710154956.3225816-1-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH v2] avutil/imgutils: av_image_check_size2() ensure width and height fit in 32bit 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="===============5160889208718316085==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============5160889208718316085== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="dZoxY5VDSg+7Vbn9" Content-Disposition: inline --dZoxY5VDSg+7Vbn9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 10, 2024 at 12:52:39PM -0300, James Almer wrote: > On 7/10/2024 12:49 PM, Michael Niedermayer wrote: > > width and height > 32bit is not supported and its easier to check in a = central place > >=20 > > Signed-off-by: Michael Niedermayer > > --- > > libavutil/imgutils.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > >=20 > > diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c > > index d2463815637..b738cff37c2 100644 > > --- a/libavutil/imgutils.c > > +++ b/libavutil/imgutils.c > > @@ -298,7 +298,7 @@ int av_image_check_size2(unsigned int w, unsigned i= nt h, int64_t max_pixels, enu > > stride =3D 8LL*w; > > stride +=3D 128*8; > > - if ((int)w<=3D0 || (int)h<=3D0 || stride >=3D INT_MAX || stride*(u= int64_t)(h+128) >=3D INT_MAX) { > > + if (w=3D=3D0 || h=3D=3D0 || w > INT32_MAX || h > INT32_MAX || stri= de >=3D INT_MAX || stride*(uint64_t)(h+128) >=3D INT_MAX) { >=20 > You could do stride*(h+128ULL) while at it, to make the line more readabl= e. will apply with this change thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB In a rich man's house there is no place to spit but his face. -- Diogenes of Sinope --dZoxY5VDSg+7Vbn9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZpGLkQAKCRBhHseHBAsP qwE4AKCJzqHPWBOis+4G7GTGeICoBcWyogCfbO3aUdCfOWitAtxp/asgYvLqJNk= =Y5/3 -----END PGP SIGNATURE----- --dZoxY5VDSg+7Vbn9-- --===============5160889208718316085== 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". --===============5160889208718316085==--