Commit f1e7c42f authored by Derek Buitenhuis's avatar Derek Buitenhuis

Merge commit '225e84e7'

* commit '225e84e7':
  hls: disallow opening nested files in child demuxers
Merged-by: 's avatarDerek Buitenhuis <derek.buitenhuis@gmail.com>
parents 6a8d05cb 225e84e7
......@@ -1484,6 +1484,16 @@ static int save_avio_options(AVFormatContext *s)
return ret;
}
static int nested_io_open(AVFormatContext *s, AVIOContext **pb, const char *url,
int flags, AVDictionary **opts)
{
av_log(s, AV_LOG_ERROR,
"A HLS playlist item '%s' referred to an external file '%s'. "
"Opening this file was forbidden for security reasons\n",
s->filename, url);
return AVERROR(EPERM);
}
static int hls_read_header(AVFormatContext *s)
{
void *u = (s->flags & AVFMT_FLAG_CUSTOM_IO) ? NULL : s->pb->opaque;
......@@ -1604,6 +1614,7 @@ static int hls_read_header(AVFormatContext *s)
goto fail;
}
pls->ctx->pb = &pls->pb;
pls->ctx->io_open = nested_io_open;
pls->stream_offset = stream_offset;
if ((ret = ff_copy_whitelists(pls->ctx, s)) < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment