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 60E9840211 for ; Mon, 21 Mar 2022 18:59:32 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9A8D168AEA2; Mon, 21 Mar 2022 20:59:29 +0200 (EET) Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [217.70.178.232]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7676668029F for ; Mon, 21 Mar 2022 20:59:23 +0200 (EET) Received: from localhost (213-47-68-29.cable.dynamic.surfer.at [213.47.68.29]) (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id C0CB6200002 for ; Mon, 21 Mar 2022 18:59:22 +0000 (UTC) Date: Mon, 21 Mar 2022 19:59:21 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220321185921.GL2829255@pb2> References: <20220312235227.19626-1-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH 1/4] avcodec/vp9_superframe_split_bsf: Check in size 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="===============8991997642458210405==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============8991997642458210405== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sNhP//kADrL8VXVs" Content-Disposition: inline --sNhP//kADrL8VXVs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Mar 13, 2022 at 04:03:42PM -0300, James Almer wrote: >=20 >=20 > On 3/12/2022 8:52 PM, Michael Niedermayer wrote: > > Fixes: Out of array read > > Fixes: 45137/clusterfuzz-testcase-minimized-ffmpeg_BSF_VP9_SUPERFRAME_S= PLIT_fuzzer-4984270639202304 > >=20 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz= /tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/vp9_superframe_split_bsf.c | 5 +++++ > > 1 file changed, 5 insertions(+) > >=20 > > diff --git a/libavcodec/vp9_superframe_split_bsf.c b/libavcodec/vp9_sup= erframe_split_bsf.c > > index ed0444561a..6af555c078 100644 > > --- a/libavcodec/vp9_superframe_split_bsf.c > > +++ b/libavcodec/vp9_superframe_split_bsf.c > > @@ -51,6 +51,11 @@ static int vp9_superframe_split_filter(AVBSFContext = *ctx, AVPacket *out) > > return ret; > > in =3D s->buffer_pkt; > > + if (in->size =3D=3D 0) { >=20 > !in->size >=20 > > + ret =3D AVERROR_INVALIDDATA; > > + goto fail; > > + } > > + > > marker =3D in->data[in->size - 1]; >=20 > Do we want to abort on in->data && !in->size, or just pass the packet > through? > I'm partial to the latter, so it would mean initializing marker to 0 and > check instead for in->size before setting marker, so the check below fails > and the packet is just passed through. >=20 > Not sure what others think about it. I have no opinion on this. I just want the bug fixed. As both andreas and ossfuzz noticed this affects other filters too. not sure the passthough makes sense for all them, i will just dumbly post a passthrough based patch for the other one ossfuzz found too but maybe erroring out as in andreas patch makes more sense thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The real ebay dictionary, page 1 "Used only once" - "Some unspecified defect prevented a second use" "In good condition" - "Can be repaird by experienced expert" "As is" - "You wouldnt want it even if you were payed for it, if you knew .= =2E." --sNhP//kADrL8VXVs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYjjLCQAKCRBhHseHBAsP q8pNAJsGee3Fk0xRHdmuOTASkci3Pe5dgwCgkuDI8Ydxa3twRxdd1WntFg3V/Vs= =EC06 -----END PGP SIGNATURE----- --sNhP//kADrL8VXVs-- --===============8991997642458210405== 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". --===============8991997642458210405==--