History

Revert "avformat/hls: Check local file extensions"

Michael Niedermayer committed 9 years ago

Commit c0702ab1 parent 10b7adf1 file · +1 −17Browse files

Unified · Split

libavformat/hls.c+1−17
@@ -204,7 +204,6 @@ typedef struct HLSContext { · 203 unmodified lines
204204 char *http_proxy; ///< holds the address of the HTTP proxy server
205205 AVDictionary *avio_opts;
206206 int strict_std_compliance;
207− char *allowed_extensions;
208207 } HLSContext;
209208
210209 static int read_chomp_line(AVIOContext *s, char *buf, int maxlen)
@@ -619,19 +618,8 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url, · 408 unmodified lines
619618 return AVERROR_INVALIDDATA;
620619
621620 // only http(s) & file are allowed
622− if (av_strstart(proto_name, "file", NULL)) {
623− if (strcmp(c->allowed_extensions, "ALL") && !av_match_ext(url, c->allowed_extensions)) {
624− av_log(s, AV_LOG_ERROR,
625− "Filename extension of \'%s\' is not a common multimedia extension, blocked for security reasons.\n"
626− "If you wish to override this adjust allowed_extensions, you can set it to \'ALL\' to allow all\n",
627− url);
628− return AVERROR_INVALIDDATA;
629− }
630− } else if (av_strstart(proto_name, "http", NULL)) {
631− ;
632− } else
621+ if (!av_strstart(proto_name, "http", NULL) && !av_strstart(proto_name, "file", NULL))
633622 return AVERROR_INVALIDDATA;
634−
635623 if (!strncmp(proto_name, url, strlen(proto_name)) && url[strlen(proto_name)] == ':')
636624 ;
637625 else if (av_strstart(url, "crypto", NULL) && !strncmp(proto_name, url + 7, strlen(proto_name)) && url[7 + strlen(proto_name)] == ':')
@@ -2146,10 +2134,6 @@ static int hls_probe(AVProbeData *p) · 1508 unmodified lines
21462134 static const AVOption hls_options[] = {
21472135 {"live_start_index", "segment index to start live streams at (negative values are from the end)",
21482136 OFFSET(live_start_index), AV_OPT_TYPE_INT, {.i64 = -3}, INT_MIN, INT_MAX, FLAGS},
2149− {"allowed_extensions", "List of file extensions that hls is allowed to access",
2150− OFFSET(allowed_extensions), AV_OPT_TYPE_STRING,
2151− {.str = "3gp,aac,avi,flac,mkv,m3u8,m4a,m4s,m4v,mpg,mov,mp2,mp3,mp4,mpeg,mpegts,ogg,ogv,oga,ts,vob,wav"},
2152− INT_MIN, INT_MAX, FLAGS},
21532137 {NULL}
21542138 };
21552139

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t