From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <ffmpeg-devel-bounces@ffmpeg.org> Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 9B0674E6F2 for <ffmpegdev@gitmailbox.com>; Sun, 11 May 2025 18:34:23 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9010668C2A0; Sun, 11 May 2025 21:34:18 +0300 (EEST) 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 086BE68BA50 for <ffmpeg-devel@ffmpeg.org>; Sun, 11 May 2025 21:34:11 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 69055438F3 for <ffmpeg-devel@ffmpeg.org>; Sun, 11 May 2025 18:34:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1746988451; 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=d7W3CtizVR0xI2IHd9FKYShB2/jDYFJSnXESKeszVW8=; b=lohFxduX93BT3MpQxbwlDgjJ2M+dtXjvj4gjhWbAM+gL07BibUVvxGGYnTyPoz5OD1N4Qi GjGDrelS261LOuQNphc1aU4lKKDoDe1d4kClqScnv5sIiThthjF5ENbmaJNEXt8hT4w9f1 dJ4l/TQOrbBRfxaxe3vMyglVGfTSkOJxzq+nKSoGTQAPOR/g3A/+qwh0r41yzcNqQfx3pj E7vb3//IHr7byxVubkN4s1WskpYCU//oz1lwNbZfpuzh9cuINjuTx/7OJlokDBylvxcnx2 pzz9sP2+8n1YoG6OhkZ5dlEJNj1fapIn98B3Ys4sxSDmOhsQ3ST/3EzQ7nxFpQ== Date: Sun, 11 May 2025 20:34:10 +0200 From: Michael Niedermayer <michael@niedermayer.cc> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Message-ID: <20250511183410.GX29660@pb2> References: <20250511154308.2078518-1-xiongweixiaoxxw@gmail.com> MIME-Version: 1.0 In-Reply-To: <20250511154308.2078518-1-xiongweixiaoxxw@gmail.com> X-GND-State: clean X-GND-Score: -90 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvleeludduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculddutddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfpihgvuggvrhhmrgihvghruceomhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtqeenucggtffrrghtthgvrhhnpeffledtfeevfeffheeuuefhtdejieelueeftdeitdfgheetgefffeefteekffdthfenucffohhmrghinhepfhhfmhhpvghgrdhorhhgnecukfhppeeguddrieeirdeijedruddufeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeguddrieeirdeijedruddufedphhgvlhhopehlohgtrghlhhhoshhtpdhmrghilhhfrhhomhepmhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtpdhnsggprhgtphhtthhopedupdhrtghpthhtohepfhhfmhhpvghgqdguvghvvghlsehffhhmphgvghdrohhrgh X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH v2] lavf: vvc_probe: enforce SPS -> PPS -> IRAP detection order to fix invalid stream detection X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org> List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe> List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel> List-Post: <mailto:ffmpeg-devel@ffmpeg.org> List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help> List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe> Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Content-Type: multipart/mixed; boundary="===============8273297435605204945==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org> Archived-At: <https://master.gitmailbox.com/ffmpegdev/20250511183410.GX29660@pb2/> List-Archive: <https://master.gitmailbox.com/ffmpegdev/> List-Post: <mailto:ffmpegdev@gitmailbox.com> --===============8273297435605204945== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Vo2ArcSjcOqS/fzO" Content-Disposition: inline --Vo2ArcSjcOqS/fzO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi xiongweixiao On Sun, May 11, 2025 at 11:43:08PM +0800, xiongweixiao wrote: > The current vvc_probe function checks for SPS, PPS, and IRAP NAL units bu= t does not enforce their detection order. This can lead to false positives = when PPS or IRAP appear before SPS, causing malformed or non-compliant bits= treams to be incorrectly identified as valid VVC streams. >=20 > This patch modifies the logic to use boolean flags and enforces the corre= ct detection sequence: SPS must be detected before PPS, and PPS before IRAP= =2E This ensures more accurate probing and prevents invalid bitstreams from= being misidentified. >=20 > This change addresses issues reported in: > - https://trac.ffmpeg.org/ticket/11496 > - https://trac.ffmpeg.org/ticket/11087 >=20 > Signed-off-by: xiongweixiao <xiongweixiaoxxw@gmail.com> >=20 > [v2] lavf: vvc_probe: fix based on review feedback >=20 > Changes since v1: > - Added a flag to force sps, pps, iraq to appear in order; > - Modified score where pps, iraq appeared in the wrong position; > - Set a smaller score for incomplete sps, pps, iraq to deal with situatio= ns that may look like vvc format >=20 The commit message no longer matches the patch > Signed-off-by: xiongweixiao <xiongweixiaoxxw@gmail.com> > --- > libavformat/vvcdec.c | 19 ++++++++++++++++--- > 1 file changed, 16 insertions(+), 3 deletions(-) >=20 > diff --git a/libavformat/vvcdec.c b/libavformat/vvcdec.c > index 0a0e24b71c..1d7be17258 100644 > --- a/libavformat/vvcdec.c > +++ b/libavformat/vvcdec.c > @@ -44,6 +44,7 @@ static int vvc_probe(const AVProbeData *p) > { > uint32_t code =3D -1; > int sps =3D 0, pps =3D 0, irap =3D 0; > + int valid_pps =3D 0, valid_irap =3D 0; > int i; > =20 > for (i =3D 0; i < p->buf_size - 1; i++) { > @@ -60,17 +61,29 @@ static int vvc_probe(const AVProbeData *p) > =20 > switch (type) { > case VVC_SPS_NUT: sps++; break; > - case VVC_PPS_NUT: pps++; break; > + case VVC_PPS_NUT: > + pps++; > + if (sps)=20 Trailing whitspace isnt allowed in our git thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Elect your leaders based on what they did after the last election, not based on what they say before an election. --Vo2ArcSjcOqS/fzO Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCaCDtnwAKCRBhHseHBAsP q5NRAJ9Zc1THlN96kpGe6BDkVC1jmY1prgCeKIoAQYloJw+W3UfeQWlDe3p577A= =jUFJ -----END PGP SIGNATURE----- --Vo2ArcSjcOqS/fzO-- --===============8273297435605204945== 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". --===============8273297435605204945==--