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 9FEE84A369 for ; Sat, 29 Jun 2024 23:40:42 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BEB1B68D77B; Sun, 30 Jun 2024 02:40:39 +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 5652668D359 for ; Sun, 30 Jun 2024 02:40:33 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id B081E1BF203 for ; Sat, 29 Jun 2024 23:40:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1719704432; 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=oF5rMuxCmUEEg7l5jl8rdDUUCulZCQYZqa9ljRruGmg=; b=VOl890+xo3eaGT1zqLR0xvCTzagmG4E0Fgp5uQbm2UveaOOVOatIhzQt7XP/XuewGzfJoK LTdPw4iAgBmJAQIJJZi/yX3H6I0t25RMBABC4y1Q2qOGWi4pCxkmxNVWPLwHUtSwwejAu+ lgk2UWonaBs6zdcmAUPZrJHCTxxBH1x3OqVroDrC3RdVYnoG2wY1Je4F8wRTgfTbBD1gFt 9IAeAOMTn6oCvECa+2s509nEfBLG2AH/qw5HfCF0K2B2KJIbVlmMuVRjbTEvzdk3kQaEus WOxs/5b7EJlu29qTJdlDbgMRLFMKh/BO6lZhgK5bjFKUSm40vnmYrV9O075OjA== Date: Sun, 30 Jun 2024 01:40:32 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240629234032.GC4991@pb2> References: <20240322230818.18997-1-michael@niedermayer.cc> <171152515798.7287.8979021106267679923@lain.khirnov.net> <20240327232702.GM6420@pb2> <20240625192546.GG4991@pb2> <171934367519.21847.12248145136761974723@lain.khirnov.net> <20240626235012.GV4991@pb2> MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 1/3] avformat/cafdec: sanity check channels and bps 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="===============6313741727689930504==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============6313741727689930504== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="NWFdL9cNbHaIJHRV" Content-Disposition: inline --NWFdL9cNbHaIJHRV Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 27, 2024 at 08:40:00AM +0200, Paul B Mahol wrote: > On Thu, Jun 27, 2024 at 1:50=E2=80=AFAM Michael Niedermayer > wrote: >=20 > > On Tue, Jun 25, 2024 at 09:27:55PM +0200, Anton Khirnov wrote: > > > Quoting Michael Niedermayer (2024-06-25 21:25:46) > > > > On Thu, Mar 28, 2024 at 12:27:02AM +0100, Michael Niedermayer wrote: > > > > > On Wed, Mar 27, 2024 at 08:39:17AM +0100, Anton Khirnov wrote: > > > > > > Quoting Michael Niedermayer (2024-03-23 00:08:16) > > > > > > > Fixes: Timeout > > > > > > > Fixes: > > 67044/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-579114436349= 1328 > > > > > > > > > > > > > > Found-by: continuous fuzzing process > > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > > > > > > > Signed-off-by: Michael Niedermayer > > > > > > > --- > > > > > > > libavformat/cafdec.c | 5 +++++ > > > > > > > 1 file changed, 5 insertions(+) > > > > > > > > > > > > > > diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c > > > > > > > index 426c56b9bd..334077efb5 100644 > > > > > > > --- a/libavformat/cafdec.c > > > > > > > +++ b/libavformat/cafdec.c > > > > > > > @@ -33,6 +33,7 @@ > > > > > > > #include "isom.h" > > > > > > > #include "mov_chan.h" > > > > > > > #include "libavcodec/flac.h" > > > > > > > +#include "libavcodec/internal.h" > > > > > > > #include "libavutil/intreadwrite.h" > > > > > > > #include "libavutil/intfloat.h" > > > > > > > #include "libavutil/dict.h" > > > > > > > @@ -87,6 +88,10 @@ static int read_desc_chunk(AVFormatContext= *s) > > > > > > > st->codecpar->ch_layout.nb_channels =3D avio_rb32(pb); > > > > > > > st->codecpar->bits_per_coded_sample =3D avio_rb32(pb); > > > > > > > > > > > > > > + if (st->codecpar->ch_layout.nb_channels > > > FF_SANE_NB_CHANNELS || > > > > > > > > > > > > I dislike this. > > > > > > > > > > I dislike it too > > > > > > > > so what do we do about this ? > > > > > > About what? What is the actual problem that needs addressed? > > > > 67044/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-579114436349= 1328 > > > > > > > > > > > any objections to apply this ? > > > > > > yes, FF_SANE_NB_CHANNELS is a hack that should be removed, not spread > > > > a maximum number for each theoretically unlimited parameter is desirable > > This can be a user setable value or a compile time value when such is > > preferred. > > >=20 > Cant you check if so many channels are actually available in stream? Iam not sure how. Maybe there is a way ... > Or there is some silly loop that goes unchecked up to INT32_MAX ? there are multiple loops one is in av_channel_layout_custom_init() another is in av_channel_layout_describe_bprint() 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 --NWFdL9cNbHaIJHRV Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZoCbbwAKCRBhHseHBAsP q4xZAKCbbjrpqU14jzvOjn9nWM8W2lhoFQCfQVQvpeUi7ClPVCsLFo6Sz4pTPhs= =1I0z -----END PGP SIGNATURE----- --NWFdL9cNbHaIJHRV-- --===============6313741727689930504== 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". --===============6313741727689930504==--