summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-09-01 00:12:47 +0200
committerwm4 <wm4@nowhere>2014-09-01 00:13:22 +0200
commit5ea84e17c03dc86222fbda5c60f2ff00152b8017 (patch)
tree61f15cc5aa0a22bb6177a4df3530cf53be97529a /player
parent129a7c056a524b33cc4c87c67d7919f8d5894ca3 (diff)
downloadmpv-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 'player')
-rw-r--r--player/loadfile.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index e685c15b80..f976832a01 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -1085,8 +1085,8 @@ static void play_current_file(struct MPContext *mpctx)
stream_filename = mpctx->resolve_result->url;
}
int stream_flags = STREAM_READ;
- if (mpctx->playlist->current->unsafe_origin && !opts->load_unsafe_playlists)
- stream_flags |= STREAM_SAFE_ONLY;
+ if (!opts->load_unsafe_playlists)
+ stream_flags |= mpctx->playlist->current->stream_flags;
mpctx->stream = stream_create(stream_filename, stream_flags, mpctx->global);
if (!mpctx->stream) { // error...
demux_was_interrupted(mpctx);
@@ -1130,9 +1130,12 @@ goto_reopen_demuxer: ;
mpctx->initialized_flags |= INITIALIZED_DEMUXER;
if (mpctx->demuxer->playlist) {
+ int entry_stream_flags =
+ (mpctx->demuxer->stream->safe_origin ? 0 : STREAM_SAFE_ONLY) |
+ (mpctx->demuxer->stream->is_network ? STREAM_NETWORK_ONLY : 0);
struct playlist *pl = mpctx->demuxer->playlist;
for (struct playlist_entry *e = pl->first; e; e = e->next)
- e->unsafe_origin |= !mpctx->demuxer->stream->safe_origin;
+ e->stream_flags |= entry_stream_flags;
transfer_playlist(mpctx, pl);
goto terminate_playback;
}