From ceb2e1026d4295d3831d080dc18f8ca5db56bc5c Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 4 Dec 2016 23:15:31 +0100 Subject: demux, stream: add option to prevent opening referenced files Quite irresponsibly hacked together. Sue me. --- demux/demux_playlist.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'demux/demux_playlist.c') diff --git a/demux/demux_playlist.c b/demux/demux_playlist.c index 7479db149f..0f2ebedd76 100644 --- a/demux/demux_playlist.c +++ b/demux/demux_playlist.c @@ -283,6 +283,8 @@ static int parse_dir(struct pl_parser *p) return 0; char *path = mp_file_get_path(p, bstr0(p->real_stream->url)); + if (!path) + return -1; char **files = NULL; int num_files = 0; @@ -339,6 +341,9 @@ static const struct pl_format *probe_pl(struct pl_parser *p) static int open_file(struct demuxer *demuxer, enum demux_check check) { + if (!demuxer->access_references) + return -1; + bool force = check < DEMUX_CHECK_UNSAFE || check == DEMUX_CHECK_REQUEST; struct pl_parser *p = talloc_zero(NULL, struct pl_parser); -- cgit v1.2.3