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 ESMTPS id 8C4A74D098 for ; Sun, 16 Feb 2025 14:34:41 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 08D3068BA75; Sun, 16 Feb 2025 16:34:37 +0200 (EET) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5B70D68B87F for ; Sun, 16 Feb 2025 16:34:31 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id 9B998442A0 for ; Sun, 16 Feb 2025 14:34:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1739716470; 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=B/fyp4ftFK4PipjBXH56cU8IJLFFW7HNeOuYYocdi5k=; b=cd2dhQWHe71qrEbQzZNQbg/D2UjDr3YuAuPbaaImkKDECC90tj9GdyQ5ZCkJTWqGgpzWJL ACMxtpcxwqXzJdhV4x+5NQpYuIv4RT6+IoWUrjGxLfsJrcaa/4H7EbVYkLdxM7y9ma22cW eOspQM9JTC7zOjGyGeSMMSV0j8j9Xemw2FXRrT5S5SYVAWTG6+r6CfpQxL/7stUMF7zEn/ tY4oq2Cps1pG0BNILl3O/cCOG7jVc1ClhTbB4T9yJj8gXvuT5bsiIIICSbnGS/H3UZyo+o sNoJoNL0RgKhBQYOJad9WdR6G/wIvm9PbcFVZXcMtP9SYH4F5KdeXksJcZj1Cw== Date: Sun, 16 Feb 2025 15:34:29 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20250216143429.GD4991@pb2> References: <20250209022421.2346210-1-michael@niedermayer.cc> <20250209022421.2346210-3-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: X-GND-State: clean X-GND-Score: -85 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdehheejudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhlucfvnfffucdludehmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcupfhivgguvghrmhgrhigvrhcuoehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgeqnecuggftrfgrthhtvghrnheptefggedvffeiueffvefhiedtgfefjedukeefgeetgeevgeejgeekvdevjeelveeknecuffhomhgrihhnpehgihhthhhusgdrtghomhenucfkphepgedurdeiiedrieejrdduudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepgedurdeiiedrieejrdduudefpdhhvghloheplhhotggrlhhhohhsthdpmhgrihhlfhhrohhmpehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgdpnhgspghrtghpthhtohepuddprhgtphhtthhopehffhhmphgvghdquggvvhgvlhesfhhfmhhpvghgrdhorhhg X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 3/6] avcodec/aac/aacdec_usac: Fix memory deallocation of pl_data 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="===============2478158794460572921==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============2478158794460572921== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ETBF5DEZPtx7b46K" Content-Disposition: inline --ETBF5DEZPtx7b46K Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 10, 2025 at 05:34:38PM +0100, Andreas Rheinhardt wrote: > Michael Niedermayer: > > Fixes: double free > > Fixes: 393523547/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_= LATM_fuzzer-6740617236905984 > >=20 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz= /tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/aac/aacdec.c | 19 +++++++++++++++++-- > > libavcodec/aac/aacdec_usac.c | 3 ++- > > 2 files changed, 19 insertions(+), 3 deletions(-) > >=20 > > diff --git a/libavcodec/aac/aacdec.c b/libavcodec/aac/aacdec.c > > index 8d50ad6d095..16259b5ada9 100644 > > --- a/libavcodec/aac/aacdec.c > > +++ b/libavcodec/aac/aacdec.c > > @@ -421,6 +421,21 @@ static uint64_t sniff_channel_order(uint8_t (*layo= ut_map)[3], int tags) > > return layout; > > } > > =20 > > +static void copy_oc(OutputConfiguration *dst, OutputConfiguration *src) > > +{ > > + int err =3D 0; >=20 > Seems unused. i saw it after sending the patch >=20 > > + > > + for(int i =3D 0; i < dst->usac.nb_elems; i++) > > + av_freep(&dst->usac.elems[i].ext.pl_data); > > + > > + *dst =3D *src; > > + > > + for(int i =3D 0; i < dst->usac.nb_elems; i++) { > > + AACUsacElemConfig *e =3D &dst->usac.elems[i]; > > + e->ext.pl_data =3D av_memdup(e->ext.pl_data, e->ext.pl_data_of= fset); >=20 > Unchecked allocation. Furthermore, the *dst =3D *src makes cleanup on > error here a PITA. > Would making pl_data reference-counted (via > RefStruct) work instead? likely, yes do you want to implement that ? thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB In a rich man's house there is no place to spit but his face. -- Diogenes of Sinope --ETBF5DEZPtx7b46K Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZ7H3dQAKCRBhHseHBAsP q4ttAJ4qpdPe3caOj6lXk1xZJIrzmhkEuACeMQIAJ/TSnMsneZuzerk8mIAunbk= =eDh7 -----END PGP SIGNATURE----- --ETBF5DEZPtx7b46K-- --===============2478158794460572921== 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". --===============2478158794460572921==--