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 E8E4B453BC for ; Mon, 25 Dec 2023 23:50:53 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 743B268D1A0; Tue, 26 Dec 2023 01:50:50 +0200 (EET) 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 306E168CEE5 for ; Tue, 26 Dec 2023 01:50:44 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id 45CFBFF806; Mon, 25 Dec 2023 23:50:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1703548243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=R5Plmz5/9gMy52qrBgocvuf5RmQcojF+cDSG8L/UWMA=; b=Vab9wYlMZ0UYXrZvKQSEDeydxTY+ENrbag6QIHtJc7ZUltlC72Mlv2TRbI9HWQRH72Eq9O Ysp9Avptz7y3ujz2J5277tIPhAbG/CY+b+Eyz/B8GjGRrrj3wnxB03+A8w+kEN8Xza3G1f cdlPzBa4OBGQgRChgW17KlFZVjAdK2B+4mYB618zBDdhzDIkao7k+HnXH3fM6qOec82tfm EmK2X2fe0XgVSW8pxzOYV6RYQx0kbq6uP3p22M6Q7tHgiCdbVqs2CqaB7xqXpZoG4+RzH/ 6PsW4Ik7Tp3Tx8BbgyJj1MLDewsEsO0YDAgO5bXHWDiJCXzfQphHAjPGeGW12g== Date: Tue, 26 Dec 2023 00:50:42 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20231225235042.GQ6420@pb2> References: <259cfc93-3e34-4081-8640-82890edbf76a@jkqxz.net> MIME-Version: 1.0 In-Reply-To: <259cfc93-3e34-4081-8640-82890edbf76a@jkqxz.net> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH] cbs_av1: Reject thirty-two zero bits in uvlc code 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 Cc: Mark Thompson Content-Type: multipart/mixed; boundary="===============5568780295722598627==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============5568780295722598627== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="d5xRKMqY7hkGAt+u" Content-Disposition: inline --d5xRKMqY7hkGAt+u Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi On Sun, Oct 22, 2023 at 07:35:52PM +0100, Mark Thompson wrote: > The spec allows at least thirty-two zero bits followed by a one to mean > 2^32-1, with no constraint on the number of zeroes. The libaom > reference decoder does not match this, instead reading thirty-two zeroes > but not the following one to mean 2^32-1. These two interpretations are > incompatible and other implementations may follow one or the other. > Therefore reject thirty-two zeroes because the intended behaviour is not > clear. > --- > libaom, dav1d and SVT-AV1 all have the same nonstandard behaviour of stop= ping at thirty-two zeroes and not reading the one. gav1 just rejects thirt= y-two zeroes. >=20 > This is also a source of arbitrarily large single syntax elements to hit = . >=20 > libavcodec/cbs_av1.c | 18 +++++++++++++----- > 1 file changed, 13 insertions(+), 5 deletions(-) >=20 > diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c > index 1d9ac5ab44..13c749a25b 100644 > --- a/libavcodec/cbs_av1.c > +++ b/libavcodec/cbs_av1.c > @@ -36,7 +36,7 @@ static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx= , GetBitContext *gbc, > CBS_TRACE_READ_START(); >=20 > zeroes =3D 0; > - while (1) { > + while (zeroes < 32) { what happened with this patch ? the git master code still aborts thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The worst form of inequality is to try to make unequal things equal. -- Aristotle --d5xRKMqY7hkGAt+u Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZYoVTgAKCRBhHseHBAsP qwFIAJ9Z/p6eizEJNH6VzxGIRZy0kbYJVQCfdUbKCdWX4f9GwOVmzafP87cLBJc= =p9ii -----END PGP SIGNATURE----- --d5xRKMqY7hkGAt+u-- --===============5568780295722598627== 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". --===============5568780295722598627==--