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 812934C263 for ; Tue, 23 Jul 2024 18:06:47 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D415468D4F6; Tue, 23 Jul 2024 21:06:44 +0300 (EEST) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E6A8068D240 for ; Tue, 23 Jul 2024 21:06:38 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 42DC81BF205 for ; Tue, 23 Jul 2024 18:06:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1721757998; 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=rpKDIQm5aw9F18+e+qeZ0C00haZpfwHOV4JzIOXDuN8=; b=EsjqQc0dCt3SOzk+rQT10iRyZevpmaY9KYLK+2K+87hMbfQ+HMQ9h1YUMuqVFMp/Ydbhqx lSL54rYZ6mVf5cFa8noQ8aDA5S3gjZHDXRqULYrjU5sv9gQ9y3QFNKC4s9t4Xglc5n6k1l bf7zKR50IUY2UYqK1zq7xJBli5OdycsqYWHFrFw+D6gQqmkBHGd8dYEifXaulXgAu/aV+9 dTKjq9k8OqWujQ+zIlQg4TqVQBLSBHf6GezUb/FKThmZF69MZbchpPo0gceja1zd3SAram GHVVS5SDVJXiez7RKSuD1eFkiniXqFNNw+gFlWxIYWEzQ2oyS9+jGNRrhE1tlQ== Date: Tue, 23 Jul 2024 20:06:37 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240723180637.GY4991@pb2> References: <20240716131929.3708881-1-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH] avformat/mov: sanity check count in IPRP 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="===============0672191485798344053==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============0672191485798344053== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="WUuc4+55fuBjY5Vl" Content-Disposition: inline --WUuc4+55fuBjY5Vl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 16, 2024 at 10:31:54AM -0300, James Almer wrote: > On 7/16/2024 10:19 AM, Michael Niedermayer wrote: > > Fixes: Timeout > > Fixes: 69230/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-65= 40512101203968 > >=20 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz= /tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer > > --- > > libavformat/mov.c | 5 +++++ > > 1 file changed, 5 insertions(+) > >=20 > > diff --git a/libavformat/mov.c b/libavformat/mov.c > > index ce95842ce58..9042753d221 100644 > > --- a/libavformat/mov.c > > +++ b/libavformat/mov.c > > @@ -8925,6 +8925,11 @@ static int mov_read_iprp(MOVContext *c, AVIOCont= ext *pb, MOVAtom atom) > > flags =3D avio_rb24(pb); > > count =3D avio_rb32(pb); > > + if (count * 5LL > a.size) { > > + ret =3D AVERROR_INVALIDDATA; > > + goto fail; > > + } >=20 > a.size is also read from the aviocontext, so i think it'd be better to add > an avio_feof() check inside the for loop below, after assoc_count is read. ok will apply with that solution thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Those who would give up essential Liberty, to purchase a little temporary Safety, deserve neither Liberty nor Safety -- Benjamin Franklin --WUuc4+55fuBjY5Vl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZp/xKQAKCRBhHseHBAsP q6hFAJ4mY+eQO+cZjPNaaeS2ug/aZV15cACfYNBP0jALGpfk9ocJa1TvqkFoHWg= =zykl -----END PGP SIGNATURE----- --WUuc4+55fuBjY5Vl-- --===============0672191485798344053== 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". --===============0672191485798344053==--