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 E66A04966C for ; Thu, 15 Feb 2024 22:35:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9DB3D68D28F; Fri, 16 Feb 2024 00:35:42 +0200 (EET) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 41E5568D26C for ; Fri, 16 Feb 2024 00:35:36 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id 2791C60004 for ; Thu, 15 Feb 2024 22:35:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1708036535; 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=epQUZStYwCz9w6fIhehKBPCc2AcX5bJSigoi7nxALj4=; b=ga/UXgLFctzj6OezLiaxw86lGWNh8BjOAQTLR/ovJ1mKDUSDbu3KII0GirXleq3vyeQqPH 09bgSQ5IZENJXkz+hXu6vmnCkpCOtwRrHbq6D8vrHUtG6GjOWLk6o+XoGNgLYXRrRhm+SA YBwd5LXD2CcnspaM+XZqMWdRF7RgyJtoxR2AZecaaRDSUxvstKtUENeIYRT4VWNfV9tJWX TPiPf+Ni5PeYHPafFpnBSn7lh5iPaUgEDh9t3IWc7RKKrm+eFtWm15WatpwbG5dDhocVfN V1gEPxEyY1WRT0kpYfUcY9igCdgx/CxK2/Oe7cYgVqcx6iA3tsWllKTmfSZfRA== Date: Thu, 15 Feb 2024 23:35:34 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240215223534.GH6420@pb2> References: <20240205200736.GS6420@pb2> MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH] [mov] Avoid OOM for invalid STCO / CO64 constructions. 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="===============5331820206807950985==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============5331820206807950985== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="l+4V+zdzffIJy/1k" Content-Disposition: inline --l+4V+zdzffIJy/1k Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 15, 2024 at 12:07:05PM -0800, Dale Curtis wrote: > On Mon, Feb 5, 2024 at 12:07=E2=80=AFPM Michael Niedermayer > wrote: >=20 > > assuming atom.size is an arbitrary 64bit value > > then the value of FFMIN() is also 64bit but entries is unsigned 32bit, > > this truncation > > would allow setting entries to values outside whats expected from FFMIN= () > > also we seem to disalllow entries =3D=3D 0 before this > > and its maybe possible to set entries =3D 0 here, bypassing the =3D=3D = 0 check > > before >=20 >=20 > Thanks. I've moved the clamp up to before the zero check. The only way a > bad 64-bit value could get in is if atom.size < 8, which I didn't think w= as > possible, but I've added a FFMAX(0,) there too. [...] > + FFMIN(avio_rb32(pb), > + FFMAX(0, (atom.size - 8) / > + (atom.type =3D=3D MKTAG('s', 't', 'c', 'o') ?= 4 : 8))); FFMIN/MAX can evaluate their arguments multiple times so avio_rb32() might be executed more than once 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." --l+4V+zdzffIJy/1k Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZc6RswAKCRBhHseHBAsP q4iiAJ96zPZtBqSzFvqolcK+AdlZBuO1KgCeM2Mh+k4yjG5PiZkq6mLDrEAVKGE= =ZEen -----END PGP SIGNATURE----- --l+4V+zdzffIJy/1k-- --===============5331820206807950985== 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". --===============5331820206807950985==--