From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 0C74A4FEF6 for ; Thu, 3 Jul 2025 20:23:08 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id E0C7868F226; Thu, 3 Jul 2025 23:23:05 +0300 (EEST) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id BCEBC68ED59 for ; Thu, 3 Jul 2025 23:22:59 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 338D5442E1 for ; Thu, 3 Jul 2025 20:22:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1751574179; 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=yQSn2X3QpO7lK1vOwy5EafEo01N5FI2WKO01vmIf9fw=; b=Yqqw3z6eR92nws3pShS4mobTsrF4sB0f2C6sFqYxcWF55/ap0oTGzfwaB3gtRma4A0aQL8 Av2MHWpqwL11fiwkFBmqfWfGW5I+k1xBoet8n4QJKyJ7qFaRbQqJk8023SBwbuAzCfG7D5 PeKpWTfZqljNvl+kOpGwW/+4DCGihn97IoVwNeKvDZ9B4/7xC0otp6Gx8apQ5YPxSvjSQO kVSr+CXeun9QgtQ1+fqaw7qGt7UuqSDuAqTbNxx7eTs+XZTOC1D7jfgXg0AounfV+n5Qjc AvMDxiZioGQkkrBxVyWL9oC0vx6/avOurg6YSpom91NmmmtA1Kip1vRirQ+5kg== Date: Thu, 3 Jul 2025 22:22:58 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20250703202258.GM29660@pb2> References: <20250703020131.2506428-1-michael@niedermayer.cc> <20250703020131.2506428-2-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: X-GND-State: clean X-GND-Score: -85 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgddvuddvfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhlucfvnfffucdludehmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcupfhivgguvghrmhgrhigvrhcuoehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgeqnecuggftrfgrthhtvghrnheptefggedvffeiueffvefhiedtgfefjedukeefgeetgeevgeejgeekvdevjeelveeknecuffhomhgrihhnpehgihhthhhusgdrtghomhenucfkphepgedurdeiiedrieeirddvvdejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepgedurdeiiedrieeirddvvdejpdhhvghloheplhhotggrlhhhohhsthdpmhgrihhlfhhrohhmpehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgdpnhgspghrtghpthhtohepuddprhgtphhtthhopehffhhmphgvghdquggvvhgvlhesfhhfmhhpvghgrdhorhhg X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 2/5] avcodec/smacker: Check input before allocation 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="===============1919510328585168949==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============1919510328585168949== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="HqdqacGvwnJXzRuX" Content-Disposition: inline --HqdqacGvwnJXzRuX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 03, 2025 at 09:14:42PM +0200, Andreas Rheinhardt wrote: > Michael Niedermayer: > > Fixes: Timeout > > Fixes: 421650030/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMAC= KAUD_fuzzer-6144441767493632 > >=20 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz= /tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/smacker.c | 4 ++++ > > 1 file changed, 4 insertions(+) > >=20 > > diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c > > index bd08bc7be28..99009bfd361 100644 > > --- a/libavcodec/smacker.c > > +++ b/libavcodec/smacker.c > > @@ -662,6 +662,10 @@ static int smka_decode_frame(AVCodecContext *avctx= , AVFrame *frame, > > } else > > values[i] =3D h.entries[0].value; > > } > > + if (get_bits_left(&gb) < (stereo+1) * (bits+1) * 8) { > > + ret =3D AVERROR_INVALIDDATA; > > + goto error; > > + } > > =20 > > if ((ret =3D ff_get_buffer(avctx, frame, 0)) < 0) > > return ret; >=20 > What about constant output (which you even optimized in > 08e82e5b572b440f4faf160d2eac923ca47a59f8)? =66rom this: if(bits) { //decode 16-bit data for(i =3D stereo; i >=3D 0; i--) pred[i] =3D av_bswap16(get_bits(&gb, 16)); =2E.. } else { //8-bit data for(i =3D stereo; i >=3D 0; i--) pred[i] =3D get_bits(&gb, 8); =2E.. } I assumed that there are at least (stereo+1) * (bits+1) * 8 bits bits can only be 0 or 1 did i miss something ? thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Does the universe only have a finite lifespan? No, its going to go on forever, its just that you wont like living in it. -- Hiranya Peiri --HqdqacGvwnJXzRuX Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCaGbmnwAKCRBhHseHBAsP q6KQAJ45ggfiCaaxK+PUHRnBVeUQuW2EtwCbBgNLY2r7Ei4gW/3UnQL0Ha2cql8= =86P1 -----END PGP SIGNATURE----- --HqdqacGvwnJXzRuX-- --===============1919510328585168949== 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". --===============1919510328585168949==--