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 0FB0B483FA for ; Sun, 3 Dec 2023 18:13:19 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 83CA168C3FD; Sun, 3 Dec 2023 20:13:16 +0200 (EET) Received: from s.wrqvtbkv.outbound-mail.sendgrid.net (s.wrqvtbkv.outbound-mail.sendgrid.net [149.72.123.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0992168AC2D for ; Sun, 3 Dec 2023 20:13:08 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=frankplowman.com; h=from:subject:mime-version:to:cc:content-type: content-transfer-encoding:cc:content-type:from:subject:to; s=s1; bh=dtNQ+NUyMNmFvYot63DkTpIwcF5gdstj+uTmDYZLHbE=; b=Clfs+MoeVEnrcoU5BZsJdoxrogjkIvlopCuEUM5ao1HqZiFh8TupOBDOeWskIbrMoj9W 9AebuUPxSIcWRKEn4u3OSwaueEefFb7k8jLq7yBSgmIS/e3elrmbZXI3kbr6k9Akdcq5sz j3rLj03jpLDtiRqRITE55NjF9D+AiFHoOcdHT6bTrTWjb5wvjLY9FInE3qeIVrmD8qRVTO 3T7UiLL4Q+N8s4cykc7o5+xAgz+kEIX4GaXNAuCHWfXOISoQid6RlJRO40DlaPdo+mgL3q jKL2Bi1+jWT/25FLTPITIsazdaWTffFTF1tuvhgiBpwf7UoOxbVI7hUs4Iy24HhA== Received: by filterdrecv-6bb8954444-zvcwj with SMTP id filterdrecv-6bb8954444-zvcwj-1-656CC532-22 2023-12-03 18:13:06.704381314 +0000 UTC m=+4059192.212857404 Received: from localhost.localdomain (unknown) by geopod-ismtpd-3 (SG) with ESMTP id rhv5VmGaS_-OCk6pQfSmfg Sun, 03 Dec 2023 18:13:06.170 +0000 (UTC) From: post@frankplowman.com Date: Sun, 03 Dec 2023 18:13:06 +0000 (UTC) Message-ID: <20231203181259.63298-1-post@frankplowman.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?c4f4aE1Y0RBySa=2FirqQxUJWZDkoLQ0t=2FfkUe34xOGiE+8p9kfzUmxLitf38=2FPx?= =?us-ascii?Q?ZYXtUOX=2FUYdUH7kSkEZ4cFdZHIZ9rnTBGoRhfdE?= =?us-ascii?Q?6nY93qLLKYSGDad+tdf4yQBaTLbBmP7KTmDEhR=2F?= =?us-ascii?Q?es35YcU8V=2FeVRpLSKAi7bL4uC5QNJH9TGcr+K0n?= =?us-ascii?Q?u9Uqzye4OjuptV4lwqKch2D2DTwO5deEte49Igw?= =?us-ascii?Q?1hD2=2F3YQbbhsEzfoE=3D?= To: ffmpeg-devel@ffmpeg.org X-Entity-ID: LpPALsXh5JN/Quf2dstifQ== Subject: [FFmpeg-devel] [PATCH] libavformat/vvc: Make probe more conservative 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: Frank Plowman Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Frank Plowman Reduce false positives for VVC files by adding additional checks in `vvc_probe`. Specifically, `nuh_temporal_id_plus1` is tested for valid values in extra cases depending on the NAL unit type, as per ITU-T H.266 section 7.4.2.2. Resolves trac=A0#10703. Signed-off-by: Frank Plowman --- libavformat/vvcdec.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libavformat/vvcdec.c b/libavformat/vvcdec.c index 31c5ae1f14..57d2769465 100644 --- a/libavformat/vvcdec.c +++ b/libavformat/vvcdec.c @@ -35,11 +35,17 @@ static int vvc_probe(const AVProbeData *p) if ((code & 0xffffff00) =3D=3D 0x100) { uint8_t nal2 =3D p->buf[i + 1]; int type =3D (nal2 & 0xF8) >> 3; + const uint8_t nuh_temporal_id_plus1 =3D nal2 & 0x7; = if (code & 0x80) // forbidden_zero_bit return 0; = - if ((nal2 & 0x7) =3D=3D 0) // nuh_temporal_id_plus1 + if (nuh_temporal_id_plus1 =3D=3D 0) // nuh_temporal_id_plus1 + return 0; + if (nuh_temporal_id_plus1 !=3D 1 && (type >=3D VVC_IDR_W_RADL = && type <=3D VVC_RSV_IRAP_11 + || type =3D=3D VVC_DCI_NUT || = type =3D=3D VVC_OPI_NUT + || type =3D=3D VVC_VPS_NUT || = type =3D=3D VVC_SPS_NUT + || type =3D=3D VVC_EOS_NUT || = type =3D=3D VVC_EOB_NUT)) return 0; = switch (type) { -- = 2.43.0 _______________________________________________ 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".