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 18F1F40B47 for ; Fri, 4 Feb 2022 15:07:21 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2837F68B266; Fri, 4 Feb 2022 17:07:19 +0200 (EET) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 66AF368B203 for ; Fri, 4 Feb 2022 17:07:12 +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 23C682000B for ; Fri, 4 Feb 2022 15:07:10 +0000 (UTC) Date: Fri, 4 Feb 2022 16:07:10 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220204150710.GR2829255@pb2> References: <20220204005811.5459-1-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: 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="===============6829071161747639788==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============6829071161747639788== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="GJkukaa7nmD6/Ded" Content-Disposition: inline --GJkukaa7nmD6/Ded Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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_fuzzer-= 6175167573786624 > >=20 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz= /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. 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 [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Whats the most studid thing your enemy could do ? Blow himself up Whats the most studid thing you could do ? Give up your rights and freedom because your enemy blew himself up. --GJkukaa7nmD6/Ded Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYf1BGQAKCRBhHseHBAsP q/lNAJ9swEf1IYTsmBNw6PtYHuaDV9wvVQCgh7dOTQpY3pn0MYhC2nKqRuszu8Y= =YgPU -----END PGP SIGNATURE----- --GJkukaa7nmD6/Ded-- --===============6829071161747639788== 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". --===============6829071161747639788==--