From 5ea84e17c03dc86222fbda5c60f2ff00152b8017 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 1 Sep 2014 00:12:47 +0200 Subject: 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. --- player/loadfile.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'player') 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; } -- cgit v1.2.3