From patchwork Tue Dec 7 12:00:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyan Doshi X-Patchwork-Id: 32107 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp6163823iog; Tue, 7 Dec 2021 04:01:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJzsgxfA5pXjaOTXZFJW1THnhC06U4Hb0xiySJxIevu4IVO0cH7vf8fbdB7PndNAhyUNiJM1 X-Received: by 2002:aa7:c946:: with SMTP id h6mr8707040edt.190.1638878473684; Tue, 07 Dec 2021 04:01:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1638878473; cv=none; d=google.com; s=arc-20160816; b=fDxXxyYdDY/Z6l7HrlaZ7geUx+JWDrBSxmcdsWn2lLrrNUmb1l4An8lXEe++0O+qr+ mDSrLB0oG13FhZJ3UHx26oKiJZ4kQ0y5bqHNg5SOewUbdbPRqQrhU8JZlIyRsHdIq8tE OGvqXYzOJvO38RmdFcWAAgYABJ07J5HbAPNicRRaOH3/Ohf3uEyfL2SOxP/dIPTRHIDW Tj0AsSNJj34YuxChvwZKMXrTzWzX/DDQs8SS/BUAF7Zfea5KOGA3ci4dMoxDZ99ODBP+ uPwOAMXzWzgee6z/gYcFdaWRBcRxmN7NViGlsLKjPj80PWjNGnVo9NOQSrOzvkg1T6N1 zpMg== 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:message-id:date:to:from :delivered-to; bh=oAO9QBKtnxbYxah/rsZYCqqnlYfsa0fkI7C4KUEVr08=; b=Rn+Tl0ud+47DnkxC3rRZFd8yiaactcfOf3iNAdGn9s/brAiEdnWdKZgqLvhtfAmh9o aUPgXVpI6Ik+PRJU7cydi145VSNA7l2BmBdF+LlJGTOYLYzE10eWALzLXz8Mq5fp30Bo XQ/s4VbPV+55xROkUhoHjI/PL24UCEZPFHDKP2ygClaKg5z713H7dXCbdNt58S6OV/do N6M4igg9cP5Np7JLAvIBxtL8KxhOV/RMJa1oaqXOu0Yk3xEUEYXBZfBU8j+/Inr+GhCx 1kboM+A3+SELebKiPutIV4Hv+8cpC6V2/epCwaOOEG1I+JD7Uiq7e/nAop6DbHNDck+9 VN/w== 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 d14si20688185ejr.605.2021.12.07.04.01.13; Tue, 07 Dec 2021 04:01:13 -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 CAD8F68AECA; Tue, 7 Dec 2021 14:01:10 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-103.mailbox.org (mout-p-103.mailbox.org [80.241.56.161]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9BFD3680CE9 for ; Tue, 7 Dec 2021 14:01:04 +0200 (EET) Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 4J7f5W5xk2zQk3h for ; Tue, 7 Dec 2021 13:01:03 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de From: Gyan Doshi To: ffmpeg-devel@ffmpeg.org Date: Tue, 7 Dec 2021 17:30:31 +0530 Message-Id: <20211207120031.6495-1-ffmpeg@gyani.pro> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/concatf: ignore trailing whitespaces 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: RstIfWKCCnc3 The concatf protocol returns an opaque error on open if concatf list file contains trailing newlines. --- libavformat/concat.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavformat/concat.c b/libavformat/concat.c index 2560811ff9..faeba2293a 100644 --- a/libavformat/concat.c +++ b/libavformat/concat.c @@ -245,6 +245,10 @@ static av_cold int concatf_open(URLContext *h, const char *uri, int flags) char *node_uri; int64_t size; size_t len = i; + int leading_spaces = strspn(cursor, " \n\t\r"); + + if (!cursor[leading_spaces]) + break; node_uri = av_get_token(&cursor, "\r\n"); if (!node_uri) {