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 9F25940932 for ; Thu, 1 Jun 2023 10:13:59 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E32DD68C23E; Thu, 1 Jun 2023 13:13:56 +0300 (EEST) Received: from knopi.disroot.org (knopi.disroot.org [178.21.23.139]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A0EEF68C0C1 for ; Thu, 1 Jun 2023 13:13:50 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 2BEE841BD7; Thu, 1 Jun 2023 12:13:50 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UV4tGbK2q0Lw; Thu, 1 Jun 2023 12:13:49 +0200 (CEST) From: metamuffin DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1685614429; bh=J8jr1RZatg/GarvUriLrEGNrMP5jsnUtXfmWy67Srq4=; h=From:To:Cc:Subject:Date; b=Rvsx8l71xvfPPEo46xQDdOGYIt0kQm148Zw4t1mzSkU9sWErqyJ60xoCFVn0Ul0D7 0S7DvAvFtWGZxR0CIGcyb5ubYQAK3q7DbZIQKmUn8/5urhUqA88dsaCm8PIUZE1cmY pkO3PzdmMT+4TzuuAt8zA4EA+GpHkUtDwpAa8w2tUdROlK88dkrILLCpZcLpXGS0rn H9+HVgPM3B71RPH7bA4FM75l7ZAFbdCg5BIS///LitIRlS5Ao3qdO1yo/Cpjp6DdVP ZGjqo+F8+aqH14xK8d4u8Chjs5/YtQeg6Upt2Pfp+iuNGr1EZYY1Kr4+HyVKZ4zi8J oMR4Wk2agj60A== To: ffmpeg-devel@ffmpeg.org Date: Thu, 1 Jun 2023 12:13:36 +0200 Message-Id: <20230601101336.24053-1-metamuffin@disroot.org> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avdevice/lavfi: fix crash on unconnected outpads 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: metamuffin 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: Nameless outpads would cause an invocation to sscanf with NULL. Example: ffmpeg -f lavfi -i 'nullsrc;nullsrc' - Changed to throwing an error instead. --- libavdevice/lavfi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c index 9c1fcf334b..21f33ade0e 100644 --- a/libavdevice/lavfi.c +++ b/libavdevice/lavfi.c @@ -174,6 +174,11 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx) * create a mapping between them and the streams */ for (i = 0, inout = output_links; inout; i++, inout = inout->next) { int stream_idx = 0, suffix = 0, use_subcc = 0; + if (!inout->name) { + av_log(avctx, AV_LOG_ERROR, + "Filtergraph has nameless outpads\n"); + FAIL(AVERROR(EINVAL)); + } sscanf(inout->name, "out%n%d%n", &suffix, &stream_idx, &suffix); if (!suffix) { av_log(avctx, AV_LOG_ERROR, -- 2.40.1 _______________________________________________ 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".