From patchwork Tue Jul 27 14:48:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 29071 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a11:4023:0:0:0:0 with SMTP id ky35csp4920375pxb; Tue, 27 Jul 2021 07:49:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDstG5Naq2g7ScuYs/f10PYyxyKkjG27Fa+J1lrjvkeBDyg55wJ7Jj1xF+2oOOtzZkDm0Q X-Received: by 2002:a17:907:1b06:: with SMTP id mp6mr22959871ejc.188.1627397391726; Tue, 27 Jul 2021 07:49:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627397391; cv=none; d=google.com; s=arc-20160816; b=JvD4mOPbfokaXIqnq/4dr2VWFmomUXRqfZBPRXj2ptlZdqssZtLMjxWytf7o6X3VUO ZFPmK2qtLdsowjVbCgnGaFopjXEOidjA+EFkaxLAoafX7Z/oJO3gJsjvJtB0HLe9Z9Vf wuwY2MyXCArQLDaSMOoy+3Ux/JsS3EERn9o4/N9aWQV2BfLrunqIHXHVMIjZo81+/Ds/ KeoRT2kOZ7rmgrrEBKDHU8uIoiWfYAmUNG2Ypis1yj0eA5boqN1mVdjUB54QuCDlxZp6 Jnf7Y3Jpvo/DR2N+3l7VOVfTYmVBCPmjqsz47fIPy5KTDtiSuDwNNAxKx6/Vc3LKBWer Mjfw== 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=w72HpTn06YGXjobtafHVj6AJsN9zjObjTwS6KxLA7Vg=; b=EY5zgpWSI23b2QeosTKD15USIDMgvcn+tzh3JZc2UoGVER/4g9GB4foOVroeMUK64r vVBECgQA9Ser10Z5d/dcnKXpgGGglGgJ7wvjgAmsOAxu0SmegflyOFsBKYcNHIYa0wyW i1VV631vISFhjBNUjoVkX2PfXPVmTXMT/FLuPOwwaN+4HtFsxaCi7GkO8F9Aq24Q0xsm JlDAijZL/K3NIiFrXDg25qAqusLUrlm4oPKYAGSAM0gkKMHtacI7BzxnBEeRMGOKY8oG 0+bRkA/U9IHY1HjIu+JM18+Z0tZAm30ZyaRWUp5F4L9meZSyglTOCMmh+y9rQxKmubo5 KjjQ== 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 a17si2965272ejb.749.2021.07.27.07.49.51; Tue, 27 Jul 2021 07:49:51 -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 D84D568A2F4; Tue, 27 Jul 2021 17:48:31 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7534C68A0B7 for ; Tue, 27 Jul 2021 17:48:23 +0300 (EEST) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 16REmKKh026223 for ; Tue, 27 Jul 2021 16:48:20 +0200 Received: by phare.normalesup.org (Postfix, from userid 1001) id 84B4CE1DC8; Tue, 27 Jul 2021 16:48:20 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Tue, 27 Jul 2021 16:48:10 +0200 Message-Id: <20210727144813.452917-8-george@nsup.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210727144813.452917-1-george@nsup.org> References: <20210727144813.452917-1-george@nsup.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Tue, 27 Jul 2021 16:48:23 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 07/10] lavf/hls: treat fs: the same way as file:. 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: 2E8Sh+rBOz5c Signed-off-by: Nicolas George --- libavformat/hls.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavformat/hls.c b/libavformat/hls.c index 3c1b80f60c..e1928b6db3 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -646,7 +646,7 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url, return AVERROR_INVALIDDATA; // only http(s) & file are allowed - if (av_strstart(proto_name, "file", NULL)) { + if (av_strstart(proto_name, "file", NULL) || av_strstart(proto_name, "fs", NULL)) { if (strcmp(c->allowed_extensions, "ALL") && !av_match_ext(url, c->allowed_extensions)) { av_log(s, AV_LOG_ERROR, "Filename extension of \'%s\' is not a common multimedia extension, blocked for security reasons.\n" @@ -667,8 +667,10 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url, ; else if (av_strstart(url, "data", NULL) && !strncmp(proto_name, url + 5, strlen(proto_name)) && url[5 + strlen(proto_name)] == ':') ; - else if (strcmp(proto_name, "file") || !strncmp(url, "file,", 5)) + else if ((strcmp(proto_name, "file") && strcmp(proto_name, "fs")) || + !strncmp(url, "file,", 5) || !strncmp(url, "fs,", 3)) { return AVERROR_INVALIDDATA; + } av_dict_copy(&tmp, *opts, 0); av_dict_copy(&tmp, opts2, 0);