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 B66D6498C1 for ; Fri, 22 Mar 2024 10:29:51 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1B09068D2A1; Fri, 22 Mar 2024 12:29:48 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 280EB68D0CE for ; Fri, 22 Mar 2024 12:29:41 +0200 (EET) Authentication-Results: mail0.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=oAuPOxw7; dkim-atps=neutral Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 73581240DAC for ; Fri, 22 Mar 2024 11:29:39 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id PDntuZcsf9uo for ; Fri, 22 Mar 2024 11:29:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1711103378; bh=BNG/UySF8BV5jrToZ1KZQciDEk0xGj+dLMQOdDFBOmg=; h=Subject:From:To:In-Reply-To:References:Date:From; b=oAuPOxw75pp0RQ0T+OgGh8D4AU2VEJ2+8ForJR+fOa1Kgk/JY8cKGDtQ4Z6UobHQX n1552tteNwXsDe+m6bUJDGzQrv7pP4xCIcdB2hET2j0uvh2HPAZct77WyJ0nMX8PWj /gI4S0FFsW8d6K767/pfNOEsF3670+vHm+6k90PITglA8y3Jinva5/3ZmeiBdROSUh EdgcPkFbvTYrDDJVXuMhU3EatQi7cqpgnNtfq+W2TIysG5JtBthPNokhRMiraFcQ37 /z75Ffc4Bkx9bTcIsRddNWwj2ioW3nnP6HAk3LUbiINZkO/XjH4uISGAzEXB7oKTWg diB+QNLE5KXSg== Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id B2F3A2404AF for ; Fri, 22 Mar 2024 11:29:38 +0100 (CET) Received: by lain.khirnov.net (Postfix, from userid 1000) id D24971601B9; Fri, 22 Mar 2024 11:29:31 +0100 (CET) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: <20240322022525.GB6420@pb2> References: <20240322022525.GB6420@pb2> Mail-Followup-To: FFmpeg development discussions and patches Date: Fri, 22 Mar 2024 11:29:31 +0100 Message-ID: <171110337183.7287.5315420652895026978@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [RFC] Channels 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Quoting Michael Niedermayer (2024-03-22 03:25:25) > Hi all > > we have code like > st->codecpar->ch_layout.nb_channels = avio_rb32(pb); > > and then somewhere there is some code that uses this by first allocating > an array and that then hits OOM > (it was this here: > map = av_calloc(nb_channels, sizeof(*channel_layout->u.map));) > > is anyone against adding a max_channels field to AVFormatContext or something > like that ? I am. > alternative is "wont fix" for all such cases, IMO it's not, in general, a bug, so EWONTFIX is the appropriate response. If the user does not want us to do arbitrarily large allocation, they have the appropriate OS-level mechanisms (e.g. ulimit, cgroups on Linux) or av_max_alloc(). -- Anton Khirnov _______________________________________________ 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".