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 9AFF247A0D for ; Sun, 28 Jan 2024 00:05:30 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2693168D11D; Sun, 28 Jan 2024 02:05:28 +0200 (EET) 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 2F37A68CACA for ; Sun, 28 Jan 2024 02:05:22 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id 5CF01240003 for ; Sun, 28 Jan 2024 00:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1706400321; 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=eLVtKynlHDKdoUl+mmQg+OYK3wtzhQU3tU/8xt2s2hg=; b=F50s7EOb8lb0cjdocm9UctlrO4oPCxIw1WqpPdagAL2qMqC+M8TW5lHprRpJMSoaotWm2u U3LLZFq43xADKdcTiiv9UYnspPmys8TOMtxelUHRb1ct66BN0UTcAV4sotXLq1VbyjrH0N 6Ue7tSbS9wsB60+52jE4wdRh81+LQqJtnpVxnUigeHKcBP1fpMPclvoCqB6ycZxrQ+JkKC UgVr9Fygn7cYswQ6qBiSIoc2+vRH9P2AlkNotQ7mKbQJhtN2Y74mol1+LXELNqY71dccl1 X53r+Y87+Vka3JPgRY5AE1S6VPi19puE2Y8POImG38Wjy/m5jNClgt1xBrN/GA== Date: Sun, 28 Jan 2024 01:05:20 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240128000520.GM6420@pb2> References: <20240126214651.22783-1-michael@niedermayer.cc> <20240126214651.22783-2-michael@niedermayer.cc> <3c7036cc-6c11-435c-bd98-084d253ac4c3@gmail.com> <20240127235655.GL6420@pb2> <9742e81b-0a57-4bd4-bcb9-b68ce006cc67@gmail.com> MIME-Version: 1.0 In-Reply-To: <9742e81b-0a57-4bd4-bcb9-b68ce006cc67@gmail.com> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 2/3] avcodec/cbs_h266_syntax_template: sanity check num_multi_layer_olss 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="===============6900874265402459457==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============6900874265402459457== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2h2L1EJYm8bdoDNX" Content-Disposition: inline --2h2L1EJYm8bdoDNX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jan 27, 2024 at 09:02:30PM -0300, James Almer wrote: > On 1/27/2024 8:56 PM, Michael Niedermayer wrote: > > On Sat, Jan 27, 2024 at 09:25:16AM -0300, James Almer wrote: > > > On 1/26/2024 6:46 PM, Michael Niedermayer wrote: > > > > It is not possible to encode a index into an empty list. Thus > > > > this must be invalid at this point or before. > > > > Its likely a broader earlier check can be used here, someone knowing > > > > VVC should look at that. Its not immedeatly obvious from the spec > > > > by looking for numlayerolss > > >=20 > > > Can you check if the following fixes it? > > >=20 > > > > diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs= _h266_syntax_template.c > > > > index 549d021211..40572dadb5 100644 > > > > --- a/libavcodec/cbs_h266_syntax_template.c > > > > +++ b/libavcodec/cbs_h266_syntax_template.c > > > > @@ -793,6 +793,7 @@ static int FUNC(vps) (CodedBitstreamContext *ct= x, RWContext *rw, > > > > { > > > > //calc NumMultiLayerOlss > > > > int m; > > > > + int num_layers_in_ols =3D 0; > > > > uint8_t dependency_flag[VVC_MAX_LAYERS][VVC_MAX_LAYERS]; > > > > uint16_t num_output_layers_in_ols[VVC_MAX_TOTAL_NUM_OLSS]; > > > > uint8_t num_sub_layers_in_layer_in_ols[VVC_MAX_TOTAL_NUM_= OLSS][VVC_MAX_TOTAL_NUM_OLSS]; > > > > @@ -895,7 +896,6 @@ static int FUNC(vps) (CodedBitstreamContext *ct= x, RWContext *rw, > > > > return AVERROR_INVALIDDATA; > > > > } > > > > for (i =3D 1; i < total_num_olss; i++) { > > > > - int num_layers_in_ols =3D 0; > > > > if (current->vps_each_layer_is_an_ols_flag) { > > > > num_layers_in_ols =3D 1; > > > > } else if (current->vps_ols_mode_idc =3D=3D 0 || > > >=20 > > > num_layers_in_ols is not meant to be reset on every loop. > >=20 > > replacing my patch by yours does not change > > num_multi_layer_olss from being 0 > > and if its 0 then "num_multi_layer_olss - 1" causes problems as a limit > >=20 > > more precissely this: > > i can also send you the file if you want? >=20 > No, this should be looked at by someone more familiar with VVC. ive already sent the fuzzer samples to nuomi and frank plowman > And my patch should be applied either way. The current code is wrong. I did not suggest not to do that :) just that it alone was not enough to fix this thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Take away the freedom of one citizen and you will be jailed, take away the freedom of all citizens and you will be congratulated by your peers in Parliament. --2h2L1EJYm8bdoDNX Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZbWaQAAKCRBhHseHBAsP q4fzAJ49JszUcydEdUQOxIl23AZHN8846ACdE/x8krEsxQV52fxQSsIqfcsqGrs= =RsKo -----END PGP SIGNATURE----- --2h2L1EJYm8bdoDNX-- --===============6900874265402459457== 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". --===============6900874265402459457==--