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 4294E45D52 for ; Sun, 7 May 2023 10:36:41 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C2EFA68C0BF; Sun, 7 May 2023 13:36:38 +0300 (EEST) Received: from knopi.disroot.org (knopi.disroot.org [178.21.23.139]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3E98B68BF97 for ; Sun, 7 May 2023 13:36:32 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 6AA1D401E7; Sun, 7 May 2023 12:36:31 +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 PkxJZi7P7ELp; Sun, 7 May 2023 12:36:30 +0200 (CEST) From: metamuffin DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1683455790; bh=J8jr1RZatg/GarvUriLrEGNrMP5jsnUtXfmWy67Srq4=; h=From:To:Cc:Subject:Date; b=a6QN1MZrqmb23/IJkr5xC6p2L8dGLzko/d5pcBOy91O9JHmV/QiWP86aUmwnDdf4Q V54KVSBSaiZJ0Etvp44dVmBY8p/wVla7QGLWBO1pmV7Ph1WiQk6h/I2POFwuRMb2Gu WSn6io183/RO3Dg6qRSZxQLd/p8Qn5qEm12q5YNhyQEd76NQwes3s2TEfFEaQGUPiV XPxaJhaovUd/PQzwGu+fib7ylVFi16GIWtcudUIc2Lq3Ocj0+hfwO7TNAIY9v3TrIl Ix+DE/z0ll+oAv0PHpEdZzc7DNUO/pHnbKxpFG1Tf88b6yklc0867vEGLsSw+fpu63 PW2IpNZXgo47A== To: ffmpeg-devel@ffmpeg.org Date: Sun, 7 May 2023 12:34:47 +0200 Message-Id: <20230507103447.199867-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".