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 7552E4A349 for ; Tue, 26 Mar 2024 19:29:47 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 80C0368CDB6; Tue, 26 Mar 2024 21:29:44 +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 1111C68C14E for ; Tue, 26 Mar 2024 21:29:38 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id 63EC1FF806 for ; Tue, 26 Mar 2024 19:29:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1711481377; 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=LebkQZZg/IzEWKiEryNV+oe20DXWbibhowMJdNFQXVI=; b=AEt0TnSMPz562d6In0WDqdOtszHQBg/qflG15RwoSW6oq5tLuLtUZWUx+Twhv4DSa7gVoT VAasH3wv7cZmOVD5Vug1jxYR8+LwTD3UWQ0qwJknAbbSg9dauyth33TNWk+gqHcC6hFY3p RS9O1MtWDM0myGTwdGl3RBdaneyYxPw9qshNuREx9sz8nx3VAvrKZFHBfzEdUXFsTnT1kb WlU2u4QUQMdKbQIlSDXIul9TSdt8CylpVSiSR7YlsLmwK4Xuk7KXyg5aICWlo6tRcrIEb1 gGOU4tyS9LkvQwunzMDScwAOgR4OlmhskNCa13nHaW5N9ou2l5BuQAeoTCWBaQ== Date: Tue, 26 Mar 2024 20:29:36 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240326192936.GD6420@pb2> References: <20240322230818.18997-1-michael@niedermayer.cc> <20240322230818.18997-2-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 2/3] avformat/mov: Do not deallocate heif_item in a input dependant way 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="===============6672985513753749627==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============6672985513753749627== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LHJ9a9Z3QgvQdC5y" Content-Disposition: inline --LHJ9a9Z3QgvQdC5y Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 25, 2024 at 10:22:19PM -0300, James Almer wrote: > On 3/22/2024 8:08 PM, Michael Niedermayer wrote: > > Fixes: out of array access > > Fixes: 67070/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-56= 85384082161664 > >=20 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz= /tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer > > --- > > libavformat/mov.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > >=20 > > diff --git a/libavformat/mov.c b/libavformat/mov.c > > index f954b924a0..a87ce5cefe 100644 > > --- a/libavformat/mov.c > > +++ b/libavformat/mov.c > > @@ -8077,7 +8077,7 @@ static int mov_read_iloc(MOVContext *c, AVIOConte= xt *pb, MOVAtom atom) > > } > > item_count =3D (version < 2) ? avio_rb16(pb) : avio_rb32(pb); > > - heif_item =3D av_realloc_array(c->heif_item, item_count, sizeof(*c= ->heif_item)); > > + heif_item =3D av_realloc_array(c->heif_item, FFMAX(item_count, c->= nb_heif_item), sizeof(*c->heif_item)); > > if (!heif_item) > > return AVERROR(ENOMEM); > > c->heif_item =3D heif_item; > > @@ -8202,7 +8202,7 @@ static int mov_read_iinf(MOVContext *c, AVIOConte= xt *pb, MOVAtom atom) > > avio_rb24(pb); // flags. > > entry_count =3D version ? avio_rb32(pb) : avio_rb16(pb); > > - heif_item =3D av_realloc_array(c->heif_item, entry_count, sizeof(*= c->heif_item)); > > + heif_item =3D av_realloc_array(c->heif_item, FFMAX(entry_count, c-= >nb_heif_item), sizeof(*c->heif_item)); > > if (!heif_item) > > return AVERROR(ENOMEM); > > c->heif_item =3D heif_item; >=20 > LGTM. will apply thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Freedom in capitalist society always remains about the same as it was in ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin --LHJ9a9Z3QgvQdC5y Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZgMiIAAKCRBhHseHBAsP q7ilAJ9M2UyV+1CS8Zt54hO1FvVaEMA//gCcCRCqb60w1qzWO95eEwJPmmj7aIY= =ICrT -----END PGP SIGNATURE----- --LHJ9a9Z3QgvQdC5y-- --===============6672985513753749627== 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". --===============6672985513753749627==--