summaryrefslogtreecommitdiff
path: root/libavformat/hls.c
diff options
context:
space:
mode:
authorMaxim Andreev <andreevmaxim@gmail.com>2016-01-13 11:51:12 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2016-01-14 00:18:00 +0100
commit7145e80b4f78cff5ed5fee04d4c4d53daaa0e077 (patch)
tree7f8ae38d631485cd789eb4cd825c546041e38abc /libavformat/hls.c
parent92465a2347d959cbd9864b017a39b2a4ab9313ff (diff)
avformat/hls: forbid all protocols except http(s) & file
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/hls.c')
-rw-r--r--libavformat/hls.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c
index cd6450178d..8063afcfdd 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -610,6 +610,10 @@ static int open_url(HLSContext *c, URLContext **uc, const char *url, AVDictionar
{
AVDictionary *tmp = NULL;
int ret;
+ const char *proto_name = avio_find_protocol_name(url);
+ // only http(s) & file are allowed
+ if (!av_strstart(proto_name, "http", NULL) && !av_strstart(proto_name, "file", NULL))
+ return AVERROR_INVALIDDATA;
av_dict_copy(&tmp, c->avio_opts, 0);
av_dict_copy(&tmp, opts, 0);