From patchwork Mon Dec 18 09:57:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 45218 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1225:b0:181:818d:5e7f with SMTP id v37csp7222507pzf; Mon, 18 Dec 2023 02:00:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IHdlnIRQvFV33ragkiecKK6epqHACuhcR4Vqkgb7nDGcN4GbZEwpnTP6Uz/FcPWZ0yuRAZj X-Received: by 2002:a50:c2c1:0:b0:552:d8bc:e471 with SMTP id u1-20020a50c2c1000000b00552d8bce471mr2583338edf.10.1702893614812; Mon, 18 Dec 2023 02:00:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702893614; cv=none; d=google.com; s=arc-20160816; b=AJ6YRDEiB0M4Xddj1ZognxE4tQKnySulES5qA9EeVN7Eigk+kcpvsmzyEKxyOXcgMt 1MoQzE/U5H6PcN0YuE5CGclJf0a5RqVTla3B2JTsfJzVzmhk6YT1V5D/+mMu+QZm+cKs hdn+wTnLJXnbKpi6vacUHkH9TYYEgjeVTGR7hdqbmI+0N2RQH7pv8YdNdqqm6Nnx5II9 DrjZL2SzNR2x52/7X4Mz7Yy1bKZSAAJBrkJZ+amND/i7z/qSVJY1F7kmlvnyvC696u26 jn+lW0/wnWn6tSRTx5TP1pMV4jYos4/BbYeumkdPdkxfeqlt+bf42vorjseMZArelXRa MbTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=W+D3uq7ME6QJFdlcWAig3BF033Owjvnoh3BKlSNCpdY=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=CFC7mxpmzlKGPoss/da/sIbh7aSmmNsrLBL3+H3dkKwFYPCBiMrWKX6IA7ImnNqxCu LpPbSoV1dQ4SNTq/Cty/WSZKtSoQRou/NWMyyHncwpSpRl50EvViGpy78xrX/9gGATmX OS4qKMmoS8GvHBpaegjtAh8LNpOGG9F9I4jnkjrouZ4QJPxhgzyb58wjMjt/hJY1+Bt3 xdBFJKGBMiU0Pxr3VwkdN13pl6d67yaiIfOWjilyGyz0IBu+h2comIjUrfdOSKD7sSfe 3av/iDMvahCTgGp7+rCFnvaA2rp/NQ4+BCSrSthF4gM+wH1iDasQoYOEkutNI1zNmPxS Gfmg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id n8-20020a05640205c800b00550e0e57ffdsi8868225edx.8.2023.12.18.02.00.12; Mon, 18 Dec 2023 02:00:14 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9165F68D2BF; Mon, 18 Dec 2023 11:58:16 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AEC8168D1EC for ; Mon, 18 Dec 2023 11:57:58 +0200 (EET) Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 606231BA1 for ; Mon, 18 Dec 2023 10:57:55 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id QNY3RDyTOa2h for ; Mon, 18 Dec 2023 10:57:55 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (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 "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id 75C6D1B9A for ; Mon, 18 Dec 2023 10:57:51 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 536AA3A073A for ; Mon, 18 Dec 2023 10:57:44 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 18 Dec 2023 10:57:11 +0100 Message-ID: <20231218095722.25879-9-anton@khirnov.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231218095722.25879-1-anton@khirnov.net> References: <20231218095722.25879-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 09/20] fftools/cmdutils: check valid flags for OPT_TYPE_FUNC 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: kq9N77W9r1RQ SPEC and OFFSET do not make sense for functions. --- fftools/cmdutils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c index 6ca2efef4a..a52c7c5ae4 100644 --- a/fftools/cmdutils.c +++ b/fftools/cmdutils.c @@ -482,6 +482,9 @@ static void check_options(const OptionDef *po) if (po->flags & OPT_PERFILE) av_assert0(po->flags & (OPT_INPUT | OPT_OUTPUT)); + if (po->type == OPT_TYPE_FUNC) + av_assert0(!(po->flags & (OPT_FLAG_OFFSET | OPT_FLAG_SPEC))); + // OPT_FUNC_ARG can only be ser for OPT_TYPE_FUNC av_assert0((po->type == OPT_TYPE_FUNC) || !(po->flags & OPT_FUNC_ARG));