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 439EC478B1 for ; Tue, 26 Dec 2023 18:37:58 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C07CE68CC0B; Tue, 26 Dec 2023 20:37:55 +0200 (EET) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8E7F268CB57 for ; Tue, 26 Dec 2023 20:37:48 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id CC13840004 for ; Tue, 26 Dec 2023 18:37:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1703615868; 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=4EoXqsZ5PFznXBGeVYHTpcZPeL0U/resXWZz5qqOXGM=; b=RO6sLm+es511g9S/3Ll3rRhen7yIbmeqGlL4VW8xJ5fnGHDsKPPfFtGo9tnKoWLN5h2irM v3RBHtEfQ3+gD4DH9ML417Ay/Qjsjg4InssVfNhat9tJw+sLgW5mv5K+WUJiQ/iXQxFrAi p7ohVCegvEZUCrvwaFyzD53i8ouqzC0ohhe8No0+J8Jn/5qjxXlo3AjPNsZrxYkAKZfdAP CBC2N+vtUMHmjHp2VZ2jxekW61vxZj1ZxymOuDQ+wdaFqekxEBye37I9euIkd80kc+E8BM 7SWOWG/sUVefkXYIiXUfcDZFxDDROxinz1gLjDus43BXSo18qnV0VxkaKKSitg== Date: Tue, 26 Dec 2023 19:37:46 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20231226183746.GT6420@pb2> References: <20231225170417.153992-1-leo.izen@gmail.com> <20231225210937.GP6420@pb2> <7d3ffc8f-b36f-43c6-b17c-d5e6e07c416b@gmail.com> MIME-Version: 1.0 In-Reply-To: <7d3ffc8f-b36f-43c6-b17c-d5e6e07c416b@gmail.com> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH v2] avcodec/jpegxl_parser: check ANS cluster alphabet size vs bundle size 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="===============4866253819896165878==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============4866253819896165878== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="UefMXxAhg/xpzpuf" Content-Disposition: inline --UefMXxAhg/xpzpuf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 26, 2023 at 08:23:35AM -0600, Leo Izen wrote: > On 12/25/23 15:09, Michael Niedermayer wrote: > > On Mon, Dec 25, 2023 at 12:04:17PM -0500, Leo Izen wrote: > > > The specification doesn't mention that clusters cannot have alphabet > > > sizes greater than 1 << bundle->log_alphabet_size, but the reference > > > implementation rejects these entropy streams as invalid, so we should > > > too. Refusing to do so can overflow a stack variable on line 556 that > > > should be large enough otherwise. > > >=20 > > > Fixes #10738. > > >=20 > > > Found-by: Zeng Yunxiang and Li Zeyuan > > > Signed-off-by: Leo Izen > > > --- > > > libavcodec/jpegxl_parser.c | 28 +++++++++++++++++++--------- > > > 1 file changed, 19 insertions(+), 9 deletions(-) > > >=20 > > > diff --git a/libavcodec/jpegxl_parser.c b/libavcodec/jpegxl_parser.c > > > index 006eb6b295..f026fda9ac 100644 > > > --- a/libavcodec/jpegxl_parser.c > > > +++ b/libavcodec/jpegxl_parser.c > > > @@ -64,26 +64,26 @@ typedef struct JXLSymbolDistribution { > > > int log_bucket_size; > > > /* this is the actual size of the alphabet */ > > > int alphabet_size; > > > - /* ceil(log(alphabet_size)) */ > > > - int log_alphabet_size; > > > /* for prefix code distributions */ > > > VLC vlc; > > > /* in case bits =3D=3D 0 */ > > > uint32_t default_symbol; > > > + /* ceil(log(alphabet_size)) */ > > > + int log_alphabet_size; > >=20 > > that seems unneeded > >=20 >=20 > dist->log_alphaebet_size is only used for prefix code distributions so I > moved it for clarity. I can also remove this change from this commit if y= ou > think it's off-topic. it belongs in a seperate patch also the 258 -> 256 should be a seperate patch IMHO Its not part of fixing the ticket >=20 > In either case, is the commit okay, apart from this one change? If so I'm > going to merge it (after I remove this one change from the diff). yes thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Old school: Use the lowest level language in which you can solve the problem conveniently. New school: Use the highest level language in which the latest supercomputer can solve the problem without the user falling asleep waiting. --UefMXxAhg/xpzpuf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZYsddwAKCRBhHseHBAsP qx4JAJ49r3CdM/LabWZ0uZdc6adXJC2S0gCgi74xa4zuU9/5c2udrFbGnC8QpAo= =beog -----END PGP SIGNATURE----- --UefMXxAhg/xpzpuf-- --===============4866253819896165878== 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". --===============4866253819896165878==--