From 572c32abbedd3860718f099743dfa973b4f58bbc Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 20 Dec 2019 08:35:08 +0100 Subject: libarchive: prefix entry names in archive URLs with '/' This has the advantage that playlists within the archive will work as expected, because demux_playlist will correctly join the archive base URL and entry name. Before this change, it could skip before the "|", resulting in a broken URL. --- stream/stream_libarchive.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'stream') diff --git a/stream/stream_libarchive.c b/stream/stream_libarchive.c index e3109dfb0a..2e300f3747 100644 --- a/stream/stream_libarchive.c +++ b/stream/stream_libarchive.c @@ -485,7 +485,9 @@ static int archive_entry_open(stream_t *stream) char *base = talloc_strdup(p, stream->path); char *name = strchr(base, '|'); *name++ = '\0'; - p->entry_name = name; + if (name[0] != '/') + return STREAM_ERROR; + p->entry_name = name + 1; mp_url_unescape_inplace(base); p->src = stream_create(base, STREAM_READ | STREAM_SAFE_ONLY, -- cgit v1.2.3