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 8B27C4AD03 for ; Tue, 18 Jun 2024 22:00:58 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 801B268D653; Wed, 19 Jun 2024 01:00:54 +0300 (EEST) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4E14368D40C for ; Wed, 19 Jun 2024 01:00:48 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 834EA40002 for ; Tue, 18 Jun 2024 22:00:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1718748047; 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=o0xsAdaWzE3KwmzchMP4692vV+gjobSYunCBi96PMQU=; b=B/dqJS/kLx3hNubmhb+rAXoVA3hfYOGu0MaN1RHyof4OjcCJECFme2h4RX/+W6As+ndc1/ U8+YUvfiBy2qm2HI9mmkHBG/z5JztpdiDDcPaPHD7UKkrfCpabJX8H4rFNzZtbaNqfyWq8 i/XaSDZzBnihLhC/hpexlCviG1gky2mbJ+IAOrWEJ2y2x5M86lHJFRwZa0xtdvyDodMMTn 38+lMMD4d4zdFIEucYN2YIbcvl/mfbUS4e9qI2LGl93MMeJpd5PSoLbRgeE8K7g2CYLlyR 99qDhdHqt3XsxjJ+GWL35PbUuCGMmEu0Uz1rWnracx1bnso/m0f4HB/mko/03g== Date: Wed, 19 Jun 2024 00:00:46 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240618220046.GK4991@pb2> References: <20240616230831.912377-1-michael@niedermayer.cc> <20240616230831.912377-2-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 2/9] avcodec/mpeg4audio: Check that there is enough space for the first 3 elements in ff_mpeg4audio_get_config_gb() 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="===============7086223745259457447==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============7086223745259457447== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="IA03tywDYuoVKXrw" Content-Disposition: inline --IA03tywDYuoVKXrw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 17, 2024 at 07:27:16AM +0200, Andreas Rheinhardt wrote: > Michael Niedermayer: > > Fixes: out of array access > > Fixes: 68863/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-4833= 546039525376 > >=20 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz= /tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/mpeg4audio.c | 4 ++++ > > 1 file changed, 4 insertions(+) > >=20 > > diff --git a/libavcodec/mpeg4audio.c b/libavcodec/mpeg4audio.c > > index fbd2a8f811a..ae18944f0d5 100644 > > --- a/libavcodec/mpeg4audio.c > > +++ b/libavcodec/mpeg4audio.c > > @@ -94,6 +94,10 @@ int ff_mpeg4audio_get_config_gb(MPEG4AudioConfig *c,= GetBitContext *gb, > > { > > int specific_config_bitindex, ret; > > int start_bit_index =3D get_bits_count(gb); > > + > > + if (get_bits_left(gb) < 5+4+4) > > + return AVERROR_INVALIDDATA; > > + > > c->object_type =3D get_object_type(gb); > > c->sample_rate =3D get_sample_rate(gb, &c->sampling_index); > > c->chan_config =3D get_bits(gb, 4); >=20 > This is not a proper fix. The real bug seems to be that > avpriv_mpeg4audio_get_config2() relies on the buffer to be padded, but > iamf_parse.c does not add padding. indeed, patch droped james already posted a better fix 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 --IA03tywDYuoVKXrw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZnIDiwAKCRBhHseHBAsP q+zgAJ0S6dnrnYTSrHvyXqGwCubDkqZ4OwCgmbTUaEZx9vCgvnG7KY1Q/pL0Mzg= =t/qG -----END PGP SIGNATURE----- --IA03tywDYuoVKXrw-- --===============7086223745259457447== 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". --===============7086223745259457447==--