mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2025-03-02 09:47:59 +00:00
Revert "avformat/hls: Check local file extensions"
Requested-by: Paul B Mahol <onemda@gmail.com> This reverts commit caf7d6178a4d5f24c915da48410a9790b21703aa.
This commit is contained in:
parent
10b7adf79d
commit
c0702ab830
@ -204,7 +204,6 @@ typedef struct HLSContext {
|
|||||||
char *http_proxy; ///< holds the address of the HTTP proxy server
|
char *http_proxy; ///< holds the address of the HTTP proxy server
|
||||||
AVDictionary *avio_opts;
|
AVDictionary *avio_opts;
|
||||||
int strict_std_compliance;
|
int strict_std_compliance;
|
||||||
char *allowed_extensions;
|
|
||||||
} HLSContext;
|
} HLSContext;
|
||||||
|
|
||||||
static int read_chomp_line(AVIOContext *s, char *buf, int maxlen)
|
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,
|
|||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
// only http(s) & file are allowed
|
// only http(s) & file are allowed
|
||||||
if (av_strstart(proto_name, "file", NULL)) {
|
if (!av_strstart(proto_name, "http", NULL) && !av_strstart(proto_name, "file", 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"
|
|
||||||
"If you wish to override this adjust allowed_extensions, you can set it to \'ALL\' to allow all\n",
|
|
||||||
url);
|
|
||||||
return AVERROR_INVALIDDATA;
|
|
||||||
}
|
|
||||||
} else if (av_strstart(proto_name, "http", NULL)) {
|
|
||||||
;
|
|
||||||
} else
|
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
if (!strncmp(proto_name, url, strlen(proto_name)) && url[strlen(proto_name)] == ':')
|
if (!strncmp(proto_name, url, strlen(proto_name)) && url[strlen(proto_name)] == ':')
|
||||||
;
|
;
|
||||||
else if (av_strstart(url, "crypto", NULL) && !strncmp(proto_name, url + 7, strlen(proto_name)) && url[7 + strlen(proto_name)] == ':')
|
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)
|
|||||||
static const AVOption hls_options[] = {
|
static const AVOption hls_options[] = {
|
||||||
{"live_start_index", "segment index to start live streams at (negative values are from the end)",
|
{"live_start_index", "segment index to start live streams at (negative values are from the end)",
|
||||||
OFFSET(live_start_index), AV_OPT_TYPE_INT, {.i64 = -3}, INT_MIN, INT_MAX, FLAGS},
|
OFFSET(live_start_index), AV_OPT_TYPE_INT, {.i64 = -3}, INT_MIN, INT_MAX, FLAGS},
|
||||||
{"allowed_extensions", "List of file extensions that hls is allowed to access",
|
|
||||||
OFFSET(allowed_extensions), AV_OPT_TYPE_STRING,
|
|
||||||
{.str = "3gp,aac,avi,flac,mkv,m3u8,m4a,m4s,m4v,mpg,mov,mp2,mp3,mp4,mpeg,mpegts,ogg,ogv,oga,ts,vob,wav"},
|
|
||||||
INT_MIN, INT_MAX, FLAGS},
|
|
||||||
{NULL}
|
{NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user