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 498A748A30 for ; Mon, 25 Dec 2023 21:09:49 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 66D0268D030; Mon, 25 Dec 2023 23:09:46 +0200 (EET) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AC9C468CDDD for ; Mon, 25 Dec 2023 23:09:39 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id DACEFE0003 for ; Mon, 25 Dec 2023 21:09:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1703538579; 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=Z9rAaDbmNNDDwfQBs4TB6cO4LnKXFhBwOp1sLh5hZLw=; b=lkGF6dHsY/Kj96xrs9paOi6BoubtbnpT78hZo9nEwrOBFxtrjv9/tSDKCH5zeLas4EHo+y 6puPFB5Gq3S4NPu9qwiqQYtH1+OgQL6+RhNq/OYYuBuIi3eXrDBDsuWbbbZ6aPOtbxXxSX cAUj4YdWHyO06RkVwuccdGhno3sDkykIEzGsyyezCHCvGaj69sjOZnYDjlqObNHpu9O6pz A2OGKCYNzjXJnOBx8C+fBOjWTsHaAYm9a8sS7wQxPV1Q82MEmqXq1v8GkQpL4X38Z3ENm+ Na+OI/4aZHjxwL9Qmmkmo58dulPn0MbJiq4DU0kBZa+nNuS6MYjDQ4Zga/TePQ== Date: Mon, 25 Dec 2023 22:09:37 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20231225210937.GP6420@pb2> References: <20231225170417.153992-1-leo.izen@gmail.com> MIME-Version: 1.0 In-Reply-To: <20231225170417.153992-1-leo.izen@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="===============2982151002213503391==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============2982151002213503391== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MXXuyh5iveicsfl4" Content-Disposition: inline --MXXuyh5iveicsfl4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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; > =20 > /* 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 thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Opposition brings concord. Out of discord comes the fairest harmony. -- Heraclitus --MXXuyh5iveicsfl4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZYnvjgAKCRBhHseHBAsP q0nmAJ4q5DCUTmp4UctNQcdbjaGJEmSSMwCfZn/v8oJHgbtmoziXWYqRToQuTPY= =sFoe -----END PGP SIGNATURE----- --MXXuyh5iveicsfl4-- --===============2982151002213503391== 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". --===============2982151002213503391==--