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 627F24266D for ; Mon, 21 Mar 2022 21:21:03 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E577468B0E7; Mon, 21 Mar 2022 23:21:00 +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 24C5A68AE62 for ; Mon, 21 Mar 2022 23:20:54 +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 6234320004 for ; Mon, 21 Mar 2022 21:20:53 +0000 (UTC) Date: Mon, 21 Mar 2022 22:20:52 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220321212052.GQ2829255@pb2> References: <20220312235227.19626-1-michael@niedermayer.cc> <20220312235227.19626-2-michael@niedermayer.cc> <20220319225052.GD2829255@pb2> <92611726582961bafbb001a9c85baf07e93dbf81.camel@acc.umu.se> <20220320140659.GF2829255@pb2> <2635ed8162a22586eb5c03c2b124267e9b9b5e02.camel@acc.umu.se> MIME-Version: 1.0 In-Reply-To: <2635ed8162a22586eb5c03c2b124267e9b9b5e02.camel@acc.umu.se> Subject: Re: [FFmpeg-devel] [PATCH 2/4] avformat/mxfdec: Check count in mxf_read_strong_ref_array() 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="===============7741305476012586104==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============7741305476012586104== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="av70RPuHaysFRWqx" Content-Disposition: inline --av70RPuHaysFRWqx Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 21, 2022 at 11:06:14AM +0100, Tomas H=E4rdin wrote: > s=F6n 2022-03-20 klockan 15:06 +0100 skrev Michael Niedermayer: > > On Sun, Mar 20, 2022 at 02:05:41PM +0100, Tomas H=E4rdin wrote: > > > l=F6r 2022-03-19 klockan 23:50 +0100 skrev Michael Niedermayer: > > [...] > > > >=20 > > > >=20 > > > > >=20 > > > > > > + > > > > > > +=A0=A0=A0 //avio_read() used int > > > > > > +=A0=A0=A0 if (c > INT_MAX / sizeof(UID)) > > > > > > +=A0=A0=A0=A0=A0=A0=A0 return AVERROR_PATCHWELCOME; > > > > > > +=A0=A0=A0 *count =3D c; > > > > > > + > > > > >=20 > > > > > This should already be caught by av_calloc(), no? > > > >=20 > > > > the API as in the documentation of av_calloc() does not gurantee > > > > this.=A0 > > >=20 > > > Yes it does: > > >=20 > > > =A0 The allocated memory will have size `size * nmemb` bytes. > > > =A0 [...] > > > =A0 `NULL` if the block cannot be allocated > >=20 > > void *av_calloc(size_t nmemb, size_t size) > > size_t can be larger than int, so size * nmemb may be larger than > > INT_MAX >=20 > Crap, you're right. This also brings to mind the question why > packages_count etc are int rather than unsigned or uint32_t.. >=20 > Patch is OK then will apply thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Opposition brings concord. Out of discord comes the fairest harmony. -- Heraclitus --av70RPuHaysFRWqx Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYjjsNAAKCRBhHseHBAsP q+BDAJ4t4T3oi1rRx1Fh8iAMty2iM5aQuwCfVRhct0bXZbFa3Nsr0HMlJhOUya8= =nilq -----END PGP SIGNATURE----- --av70RPuHaysFRWqx-- --===============7741305476012586104== 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". --===============7741305476012586104==--