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 2BF4240EB7 for ; Wed, 9 Feb 2022 09:51:53 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9782868B229; Wed, 9 Feb 2022 11:51:51 +0200 (EET) Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5E19F68A906 for ; Wed, 9 Feb 2022 11:51:45 +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 1C9D9100007 for ; Wed, 9 Feb 2022 09:51:43 +0000 (UTC) Date: Wed, 9 Feb 2022 10:51:43 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220209095143.GX2829255@pb2> References: <20220204005811.5459-1-michael@niedermayer.cc> <20220204150710.GR2829255@pb2> MIME-Version: 1.0 In-Reply-To: <20220204150710.GR2829255@pb2> Subject: Re: [FFmpeg-devel] [PATCH 1/2] avformat/matroskadec: Fix infinite loop with bz decompression 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="===============6969712793582721902==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============6969712793582721902== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dufcdv4ZiuIBj7v6" Content-Disposition: inline --dufcdv4ZiuIBj7v6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 04, 2022 at 04:07:10PM +0100, Michael Niedermayer wrote: > On Fri, Feb 04, 2022 at 04:29:18AM +0100, Andreas Rheinhardt wrote: > > Michael Niedermayer: > > > Fixes: Infinite loop > > > Fixes: 43932/clusterfuzz-testcase-minimized-ffmpeg_dem_MATROSKA_fuzze= r-6175167573786624 > > >=20 > > > Found-by: continuous fuzzing process https://github.com/google/oss-fu= zz/tree/master/projects/ffmpeg > > > Signed-off-by: Michael Niedermayer > > > --- > > > libavformat/matroskadec.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > >=20 > > > diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c > > > index d165f6ab90..5a9acfb247 100644 > > > --- a/libavformat/matroskadec.c > > > +++ b/libavformat/matroskadec.c > > > @@ -1742,7 +1742,7 @@ static int matroska_decode_buffer(uint8_t **buf= , int *buf_size, > > > case MATROSKA_TRACK_ENCODING_COMP_BZLIB: > > > { > > > bz_stream bzstream =3D { 0 }; > > > - if (BZ2_bzDecompressInit(&bzstream, 0, 0) !=3D BZ_OK) > > > + if (!pkt_size || BZ2_bzDecompressInit(&bzstream, 0, 0) !=3D = BZ_OK) > > > return -1; > > > bzstream.next_in =3D data; > > > bzstream.avail_in =3D isize; > >=20 > > I see nothing in the zlib-API manual that would preclude this from > > happening with zlib, too, so it should be checked there, too. > > LGTM apart from that. >=20 > It didnt happen with the same case when i just routed it to the zlib > instead of bz case. But i didnt look what happened exactly will apply with the check for zlib too, it feels like a good idea even when it seems not needed thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The day soldiers stop bringing you their problems is the day you have stopp= ed=20 leading them. They have either lost confidence that you can help or conclud= ed=20 you do not care. Either case is a failure of leadership. - Colin Powell --dufcdv4ZiuIBj7v6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYgOOrwAKCRBhHseHBAsP q+4HAJ4hRUzbtW23cPXsUoEN0F4+BWNdiACdGUP9Rxf9Ca3Vvh0SDWEO19zGElo= =+GS9 -----END PGP SIGNATURE----- --dufcdv4ZiuIBj7v6-- --===============6969712793582721902== 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". --===============6969712793582721902==--