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 C78E24C257 for ; Tue, 23 Jul 2024 18:27:54 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B00EC68D4F6; Tue, 23 Jul 2024 21:27:51 +0300 (EEST) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C8EA068D22E for ; Tue, 23 Jul 2024 21:27:44 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 98F01C0005 for ; Tue, 23 Jul 2024 18:27:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1721759263; 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=EK8Joo8Lp3FJQJIUI1QpAcxzP7XcZSFB6Bl5YhmS+v0=; b=mvNgghWlb3CPHs3w0D48/RtqyU9X84xaYHltMpKd+5WguBN43td3mgQJCZEe+KDdHL86Ss 14hlpRmtc+meT4LVZq4ZPrmGb5QfV7guDa67tCbbtp8vnYhxgQErsizQVT0cWJvHV4pQkH SzYaB0x+HOA1Ew/YWUTynMFZ+cNaaysJ9MePSudskY390ZkzBBCQGGc19Ar5hIxxQnhOP6 8UFAoW8PQS3cx0tBiDDuHRCRdqv3l5kIdlgsZzMmCGrMfXB3UbSDGTACh3QKXdvdALPgbB cqYZB9krO/XGhTqguOLrEKXlU9fYQ7nHka7hwF+oMlgDj5Vo1uoGuTn6eFmhyA== Date: Tue, 23 Jul 2024 20:27:42 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240723182742.GA4991@pb2> References: <20240715144825.3652038-1-michael@niedermayer.cc> <172119856184.21847.8183623909028998274@lain.khirnov.net> MIME-Version: 1.0 In-Reply-To: <172119856184.21847.8183623909028998274@lain.khirnov.net> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH v2] avcodec/hevc/hevcdec: Do not allow slices to depend on failed slices 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="===============8395840374189978037==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============8395840374189978037== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="WnTNnZ8qPt9DEgcx" Content-Disposition: inline --WnTNnZ8qPt9DEgcx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 17, 2024 at 08:42:41AM +0200, Anton Khirnov wrote: > Quoting Michael Niedermayer (2024-07-15 16:48:25) > > An alternative would be to leave the context unchanged on failure of hl= s_slice_header() > >=20 > > Fixes: out of array access > > Fixes: NULL pointer dereference > > Fixes: 69584/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuz= zer-5931086299856896 > > Fixes: 69724/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuz= zer-5104066422702080 > >=20 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz= /tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/hevc/hevcdec.c | 12 ++++++++---- > > 1 file changed, 8 insertions(+), 4 deletions(-) > >=20 > > diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c > > index 0e4b26dad3b..80d59ab1916 100644 > > --- a/libavcodec/hevc/hevcdec.c > > +++ b/libavcodec/hevc/hevcdec.c > > @@ -621,6 +621,10 @@ static int hls_slice_header(SliceHeader *sh, const= HEVCContext *s, GetBitContext > > =20 > > if (pps->dependent_slice_segments_enabled_flag) > > sh->dependent_slice_segment_flag =3D get_bits1(gb); > > + if (sh->dependent_slice_segment_flag && !s->slice_initialized)= { > > + av_log(s->avctx, AV_LOG_ERROR, "dependent slice failed\n"); >=20 > The new error message seems worse than the old one. A slice is a passive > object, "slice failed" makes no sense. will leave the error message >=20 > > @@ -3155,8 +3156,11 @@ static int decode_slice(HEVCContext *s, const H2= 645NAL *nal, GetBitContext *gb) > > int ret; > > =20 > > ret =3D hls_slice_header(&s->sh, s, gb); > > - if (ret < 0) > > + if (ret < 0) { > > + //The code is not capable to rewind from an error, the state n= ow is inconsistant so we cannot use it on depandant slices > = ^ ^ > = e e > Also I'd drop everything before the comma, why mention rewinding that is > not implemented and may not be a good idea anyway. will word it differently >=20 > Otherwise patch LGTM. will apply thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The educated differ from the uneducated as much as the living from the dead. -- Aristotle=20 --WnTNnZ8qPt9DEgcx Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZp/2FAAKCRBhHseHBAsP qylrAJ4u4iCPzHPPGpO3Wy7u4fhGTVbckgCfWsuEW3AlmpHT0Rmxav1pPgCngwY= =rJlc -----END PGP SIGNATURE----- --WnTNnZ8qPt9DEgcx-- --===============8395840374189978037== 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". --===============8395840374189978037==--