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 4FECC483B8 for ; Mon, 1 Apr 2024 01:05:51 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8637B68CD49; Mon, 1 Apr 2024 04:05:48 +0300 (EEST) 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 6015468BD24 for ; Mon, 1 Apr 2024 04:05:42 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 78706FF803 for ; Mon, 1 Apr 2024 01:05:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1711933541; 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=w7psxelX3ILsK0pPpJrSXGBbC9Pe/cWKqAj7BEed/ec=; b=ZQyDOPM/79aVLVwCgAMFk7ev7IQ1rintXWVuPdhKIj+FL9OgM7JBctlwO8Reobrzx9WUwZ cYcuz21j6Ccj0O9U6f4winAfv/oNXnf+ZaFKhDCsTMwG5Lt1s4npj0ogyWhina+JZjieXp lF7JRzwv7Ay8f/m0Lw7u/JEjPI0vVUwXwTJ0iGvrWI1RUVhJxH6Z9WERatH/hpCwQjNmBf a+zvVkjnfbqH9aEIKj0MDRSXa6df/iRZiHAr8tRsFgEww0Ck4VqClVnXMKbHLlm4agWJKi oXbaT45SMpID66EbBYXVlkIsP8pQVWRGTNzrRN8ze3JmIyHtuUYjUtwfmHtb7w== Date: Mon, 1 Apr 2024 03:05:40 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240401010540.GZ6420@pb2> References: <20240321011517.10363-1-michael@niedermayer.cc> <20240321011517.10363-4-michael@niedermayer.cc> <00907e21-57ef-4c45-836b-0535c3755cd0@gmail.com> <20240321035546.GZ6420@pb2> MIME-Version: 1.0 In-Reply-To: <20240321035546.GZ6420@pb2> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 4/4] avformat/iamf: Check language_label 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="===============3383311066263227918==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============3383311066263227918== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8ajnA0js7/l+QPdD" Content-Disposition: inline --8ajnA0js7/l+QPdD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 21, 2024 at 04:55:46AM +0100, Michael Niedermayer wrote: > On Wed, Mar 20, 2024 at 11:17:09PM -0300, James Almer wrote: > > On 3/20/2024 10:15 PM, Michael Niedermayer wrote: > > > Fixes: null pointer dereference > > > Fixes: 67023/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-60= 11025237278720 > > >=20 > > > Found-by: continuous fuzzing process https://github.com/google/oss-fu= zz/tree/master/projects/ffmpeg > > > Signed-off-by: Michael Niedermayer > > > --- > > > libavformat/iamf.c | 7 ++++--- > > > 1 file changed, 4 insertions(+), 3 deletions(-) > > >=20 > > > diff --git a/libavformat/iamf.c b/libavformat/iamf.c > > > index 5de70dc082..f2c22ce3aa 100644 > > > --- a/libavformat/iamf.c > > > +++ b/libavformat/iamf.c > > > @@ -89,9 +89,10 @@ void ff_iamf_free_mix_presentation(IAMFMixPresenta= tion **pmix_presentation) > > > if (!mix_presentation) > > > return; > > > - for (int i =3D 0; i < mix_presentation->count_label; i++) > > > - av_free(mix_presentation->language_label[i]); > > > - av_free(mix_presentation->language_label); > > > + if (mix_presentation->language_label) > >=20 > > If count_label is not 0, then language_label should be allocated. > >=20 > > > + for (int i =3D 0; i < mix_presentation->count_label; i++) > > > + av_free(mix_presentation->language_label[i]); > > > + av_freep(&mix_presentation->language_label); > > > av_iamf_mix_presentation_free(&mix_presentation->mix); > > > av_freep(pmix_presentation); > > > } > >=20 > > Can you test the following? > >=20 > > > diff --git a/libavformat/iamf_parse.c b/libavformat/iamf_parse.c > > > index cb49cf0a57..e29c2c6b6c 100644 > > > --- a/libavformat/iamf_parse.c > > > +++ b/libavformat/iamf_parse.c > > > @@ -822,6 +822,7 @@ static int mix_presentation_obu(void *s, IAMFCont= ext *c, AVIOContext *pb, int le > > > mix_presentation->language_label =3D av_calloc(mix_presentation-= >count_label, > > > sizeof(*mix_present= ation->language_label)); > > > if (!mix_presentation->language_label) { > > > + mix_presentation->count_label =3D 0; > > > ret =3D AVERROR(ENOMEM); > > > goto fail; > > > } >=20 > that works too, i think pointers should be set to NULL on deallocation th= ough i will apply this alternative txh [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Let us carefully observe those good qualities wherein our enemies excel us and endeavor to excel them, by avoiding what is faulty, and imitating what is excellent in them. -- Plutarch --8ajnA0js7/l+QPdD Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZgoIXQAKCRBhHseHBAsP q11SAJ9JmIQXoRht5Z+mTySG0Q5OSj7vBACeNL4F9iCmMSLp2W410WhJiOXDECY= =Evor -----END PGP SIGNATURE----- --8ajnA0js7/l+QPdD-- --===============3383311066263227918== 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". --===============3383311066263227918==--