diff options
author | wm4 <wm4@nowhere> | 2014-09-01 00:12:47 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-09-01 00:13:22 +0200 |
commit | 5ea84e17c03dc86222fbda5c60f2ff00152b8017 (patch) | |
tree | 61f15cc5aa0a22bb6177a4df3530cf53be97529a /stream/stream.c | |
parent | 129a7c056a524b33cc4c87c67d7919f8d5894ca3 (diff) | |
download | mpv-5ea84e17c03dc86222fbda5c60f2ff00152b8017.tar.bz2 mpv-5ea84e17c03dc86222fbda5c60f2ff00152b8017.tar.xz |
player: don't allow remote playlists to load local files
Because that might be a bad idea.
Note that remote playlists still can use any protocol marked with
is_safe and is_network, because the case of http-hosted playlists
containing URLs using other streaming protocols is not unusual.
Diffstat (limited to 'stream/stream.c')
-rw-r--r-- | stream/stream.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/stream/stream.c b/stream/stream.c index 226626cf3c..455c0a5409 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -261,6 +261,8 @@ static int open_internal(const stream_info_t *sinfo, struct stream *underlying, return STREAM_NO_MATCH; if (!sinfo->is_safe && (flags & STREAM_SAFE_ONLY)) return STREAM_UNSAFE; + if (!sinfo->is_network && (flags & STREAM_NETWORK_ONLY)) + return STREAM_UNSAFE; const char *path = NULL; // Stream filters use the original URL, with no protocol matching at all. @@ -284,6 +286,7 @@ static int open_internal(const stream_info_t *sinfo, struct stream *underlying, s->path = talloc_strdup(s, path); s->source = underlying; s->allow_caching = true; + s->is_network = sinfo->is_network; s->mode = flags & (STREAM_READ | STREAM_WRITE); if ((s->mode & STREAM_WRITE) && !sinfo->can_write) { @@ -797,6 +800,7 @@ static stream_t *open_cache(stream_t *orig, const char *name) cache->lavf_type = talloc_strdup(cache, orig->lavf_type); cache->safe_origin = orig->safe_origin; cache->streaming = orig->streaming, + cache->is_network = orig->is_network; cache->opts = orig->opts; cache->global = orig->global; |