From patchwork Wed Jun 14 16:48:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 42073 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c526:b0:117:ac03:c9de with SMTP id gm38csp191143pzb; Wed, 14 Jun 2023 09:51:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7LnBQ8mBJwbcgB2YGEybpI9hmeTYPjoiUhadvc6/Gj01sclwOXGzrgcTgVV8VoFg1SpiW7 X-Received: by 2002:a17:907:720c:b0:974:5bd2:1807 with SMTP id dr12-20020a170907720c00b009745bd21807mr2065851ejc.24.1686761516050; Wed, 14 Jun 2023 09:51:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686761516; cv=none; d=google.com; s=arc-20160816; b=S+3yuvrGWwxEp+kg3cd04jN0f8R/DFcLzGePQk4nruFMODv23gtrKS9r0BlSTui2YN A5DU/ozvBofJA/gmv1t5SUiuDJtwM/T9YUwpYZ6/7WHmzdkNvMFBpcKSNXnNmYRhYnRb qv7Kf6zIliVlmqVcLGIWuR9RbSfMwnQmKbOxACOLKDNuyMMAgHXEvb6TgpW2HpyafS6k HvKyBo8A0tvvszSIyST/iyplvc584QxelWdJ7TmDW39KGx3A9m184PE2sj6D1jf2BY38 3rVl7aZ00Bbng1VGZQvkDob+Djs5xwUa+oXJA8v/h8b753HxSYBKOcSTZJrTR0RfL+zi UYYQ== 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=nhyc8ICxWmhFMkBdQDiYTlgJZ/Y5jdiSdYWTWbTaaE4=; b=pLpvxCXHFg2rNt2/6hluEmG24VHHbRiqqzlPehAisW+5DEQ2qmGNvA/NjL2hRb15vB ikZYmgqZC8U5FBErZBOrV42enzNTDfnax2p14JDADSQrk4CoPMEvAIQRQrOxqKd6ywcS h+Bxko+anRd4Zc8m+fZsaNPIZ0PIEKah6gjn1u5+PEIPnrwFHSn3B1Q+btM7NixwHu7+ HP8RDeWJEqFZ/zr9zwZ/iOBKm5UFD9A1X3Fkc2LIz3jBeWeyrLofmOC8SZwc4ufrRai6 wIxUziKuE//XluKxHx6KROjxLXW4QjbWZrZh1ZGS0Bw6/tV0b1uCJoNo8EK4mr1s1KCj tWQg== 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 s13-20020a170906c30d00b0096a1843be21si8415246ejz.599.2023.06.14.09.51.55; Wed, 14 Jun 2023 09:51:56 -0700 (PDT) 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 D450B68C4DF; Wed, 14 Jun 2023 19:50:11 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 48CB568C472 for ; Wed, 14 Jun 2023 19:50:03 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 09F322404F5 for ; Wed, 14 Jun 2023 18:50:03 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 66qoDbumTwa0 for ; Wed, 14 Jun 2023 18:50:02 +0200 (CEST) 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 mail0.khirnov.net (Postfix) with ESMTPS id 1B3C32406D0 for ; Wed, 14 Jun 2023 18:49:54 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id A815A3A0909 for ; Wed, 14 Jun 2023 18:49:47 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 14 Jun 2023 18:48:59 +0200 Message-Id: <20230614164908.28712-12-anton@khirnov.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230614164908.28712-1-anton@khirnov.net> References: <20230614164908.28712-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 12/21] fftools/ffmpeg_filter: reject filtergraphs with zero outputs 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: rU41h2Vb+WJB Nothing useful can be done with them currently. --- fftools/ffmpeg_filter.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 4f7565e44e..54c7ed1f5c 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -845,6 +845,12 @@ FilterGraph *fg_create(char *graph_desc) ofilter->name = describe_filter_link(fg, cur, 0); } + if (!fg->nb_outputs) { + av_log(fg, AV_LOG_FATAL, "A filtergraph has zero outputs, this is not supported\n"); + ret = AVERROR(ENOSYS); + goto fail; + } + fail: avfilter_inout_free(&inputs); avfilter_inout_free(&outputs);