diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-02-29 15:50:32 +0000 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-02-29 15:50:32 +0000 |
commit | f1e7c42f08d0370b8d47c2ca3d2c043d19d3fa8a (patch) | |
tree | f182fa450129acacb0b5f6c5113ed03eab43666f /libavformat | |
parent | 6a8d05cb4d1559e7246597150b836a78e419fdd1 (diff) | |
parent | 225e84e74544062706c0159ec0737b0e1d40915f (diff) | |
download | ffmpeg-f1e7c42f08d0370b8d47c2ca3d2c043d19d3fa8a.tar.gz |
Merge commit '225e84e74544062706c0159ec0737b0e1d40915f'
* commit '225e84e74544062706c0159ec0737b0e1d40915f':
hls: disallow opening nested files in child demuxers
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/hls.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c index b7ef24290e..aa5d60e647 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -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) |