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 4E2F740BCA for ; Tue, 8 Mar 2022 11:48:49 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 658A668B0A8; Tue, 8 Mar 2022 13:48:47 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B04D468B050 for ; Tue, 8 Mar 2022 13:48:40 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id E9744240179; Tue, 8 Mar 2022 12:48:39 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id oPLjT5Lp75Bk; Tue, 8 Mar 2022 12:48:39 +0100 (CET) Received: from lain.red.khirnov.net (lain.red.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.red.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 29A892400F5; Tue, 8 Mar 2022 12:48:39 +0100 (CET) Received: by lain.red.khirnov.net (Postfix, from userid 1000) id 60C871601AD; Tue, 8 Mar 2022 12:48:35 +0100 (CET) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: <20220304150307.61769-1-ffmpeg@haasn.xyz> References: <20220304150307.61769-1-ffmpeg@haasn.xyz> Mail-Followup-To: FFmpeg development discussions and patches , Niklas Haas Date: Tue, 08 Mar 2022 12:48:35 +0100 Message-ID: <164674011536.19727.522116367172581993@lain.red.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 1/2] lavu: add syntax for loading AV_OPT_TYPE_BINARY from files 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 Cc: Niklas Haas 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 Niklas Haas (2022-03-04 16:03:06) > From: Niklas Haas > > I arbitrarily decided to use the syntax 'opt=@filename' to match e.g. > `curl -Ffield=@filename`, and also because @ is not a valid hex > character, nor does it conflict with any other common shell or ffmpeg > syntax. > > This is arguably somewhat clunky because it does not round-trip with > av_opt_get - you will get back a hex interpretation of the loaded file, > rather than the filename it was loaded from. It also implies a (perhaps > unnecessary) memcpy from mapped file memory into a allocated memory. > This is unfortunately necessary because there's no way for us to know > whether av_free or av_file_unmap is needed to clean up previous option > values. > > The motivating use case was the introduction of several new binary > options for vf_libplacebo, but other filters that currently rely on > manual file-path loading could benefit from it as well. Sorry, I think having an arbitrary file loader in the options parser will be an endless security nightmare. The alternative I had in mind was having ffmpeg.c itself do the file loading. This will be require some modification of the options parsing code in cmdutils.c and also extending the mechanisms we use to pass options to filters. I can try to make a POC in a few days. -- 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".