[FFmpeg-devel] [PATCH 07/10] lavf/hls: treat fs: the same way as file:.

Nicolas George george at nsup.org
Tue Jul 27 17:48:10 EEST 2021


Signed-off-by: Nicolas George <george at nsup.org>
---
 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);
-- 
2.30.2



More information about the ffmpeg-devel mailing list