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 6DDB44CDE9 for ; Wed, 14 May 2025 12:43:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5D26C68C339; Wed, 14 May 2025 15:43:42 +0300 (EEST) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C5D6D68C2B6 for ; Wed, 14 May 2025 15:43:35 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 2C10A42F79 for ; Wed, 14 May 2025 12:43:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1747226615; 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=MbIzcJIZt235CbAOs+q0qJBZ/A9YomihF+9mSd6wzKA=; b=GnF5FY+tkfqyBXsggvQc5Yo6i6Eaon9IRHI8g6M/BbqZuF17zw6uG2tfzFqLQH9MV0mTQs Yiplusig+aLXX1ETKmRZO5oOiYDAT+G6V6i4NecSQuGNYbN3sju1wsAWxYafRHC4DOFFy/ nA4ZrhPh+nCeTE30J5kg6S72Cz0CvMYYx/SlrMn2wxMilxzdq0aIXLFhga7QYbvQcjBxwn Dzvn3reCfhDIZnDyolAmdWbDAM0awoMqRVgxMuwevzMtXY9baKUubYk+ZDWqfGz/Tzdeab fuPgyga3Avj6BQrwLCqbW012fWgf4xPwljKeJsvst0b3Lg6EXTPiR8pfMXwUBA== Date: Wed, 14 May 2025 14:43:34 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20250514124334.GK29660@pb2> References: <20250513162533.GE29660@pb2> <20250513234500.4930-1-jamrial@gmail.com> MIME-Version: 1.0 In-Reply-To: <20250513234500.4930-1-jamrial@gmail.com> X-GND-State: clean X-GND-Score: -85 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeftdejtddvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculdduhedmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfpihgvuggvrhhmrgihvghruceomhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtqeenucggtffrrghtthgvrhhnpeetgfegvdffieeuffevhfeitdfgfeejudekfeegteegveegjeegkedvveejleevkeenucffohhmrghinhepghhithhhuhgsrdgtohhmnecukfhppeeguddrieeirdeijedruddufeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeguddrieeirdeijedruddufedphhgvlhhopehlohgtrghlhhhoshhtpdhmrghilhhfrhhomhepmhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtpdhnsggprhgtphhtthhopedupdhrtghpthhtohepfhhfmhhpvghgqdguvghvvghlsehffhhmphgvghdrohhrgh X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH] avformat/iamf_parse: increase PutBytes buffer when writing AAC extradata 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="===============3366314118461219079==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============3366314118461219079== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="bpLp2UQ2ZKz+SLe4" Content-Disposition: inline --bpLp2UQ2ZKz+SLe4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 13, 2025 at 08:45:00PM -0300, James Almer wrote: > We may write up to 43 bits, so 5 bytes is not enough. >=20 > Fixes: Assertion n>=3D0 && n<=3D32 failed at ./libavcodec/get_bits.h:406 > Fixes: 398527871/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-66= 02025714647040 >=20 > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/t= ree/master/projects/ffmpeg > Signed-off-by: James Almer > --- > libavformat/iamf_parse.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) >=20 > diff --git a/libavformat/iamf_parse.c b/libavformat/iamf_parse.c > index abedfdb066..11c27ebe98 100644 > --- a/libavformat/iamf_parse.c > +++ b/libavformat/iamf_parse.c > @@ -285,7 +285,7 @@ static int update_extradata(AVCodecParameters *codecp= ar) > AV_WL16A(codecpar->extradata + 16, AV_RB16A(codecpar->extradata = + 16)); // Byte swap Output Gain > break; > case AV_CODEC_ID_AAC: { > - uint8_t buf[5]; > + uint8_t buf[6]; > =20 > init_put_bits(&pb, buf, sizeof(buf)); > ret =3D init_get_bits8(&gb, codecpar->extradata, codecpar->extra= data_size); > @@ -304,6 +304,10 @@ static int update_extradata(AVCodecParameters *codec= par) > skip_bits(&gb, 4); > put_bits(&pb, 4, codecpar->ch_layout.nb_channels); // set channe= l config > ret =3D put_bits_left(&pb); > + while (ret >=3D 32) { > + put_bits32(&pb, get_bits_long(&gb, 32)); > + ret -=3D 32; > + } > put_bits(&pb, ret, get_bits_long(&gb, ret)); > flush_put_bits(&pb); bit_copy() from libavcodec/dvdec.c seems doing the same maybe this can be factored somewhere before or after this patch thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Into a blind darkness they enter who follow after the Ignorance, they as if into a greater darkness enter who devote themselves to the Knowledge alone. -- Isha Upanishad --bpLp2UQ2ZKz+SLe4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCaCSP8gAKCRBhHseHBAsP q+dPAJ9GjuaOkFDnEyzfNW7xGX16DUQkzACfWjrT5Kieuz6T/zCNQS8F02yX2ZE= =8LUT -----END PGP SIGNATURE----- --bpLp2UQ2ZKz+SLe4-- --===============3366314118461219079== 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". --===============3366314118461219079==--