Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
225e84e7
Commit
225e84e7
authored
Feb 15, 2016
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hls: disallow opening nested files in child demuxers
parent
e192cd9c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
hls.c
libavformat/hls.c
+11
-0
No files found.
libavformat/hls.c
View file @
225e84e7
...
@@ -494,6 +494,16 @@ static int save_avio_options(AVFormatContext *s)
...
@@ -494,6 +494,16 @@ static int save_avio_options(AVFormatContext *s)
return
ret
;
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
)
static
int
hls_read_header
(
AVFormatContext
*
s
)
{
{
HLSContext
*
c
=
s
->
priv_data
;
HLSContext
*
c
=
s
->
priv_data
;
...
@@ -579,6 +589,7 @@ static int hls_read_header(AVFormatContext *s)
...
@@ -579,6 +589,7 @@ static int hls_read_header(AVFormatContext *s)
goto
fail
;
goto
fail
;
}
}
v
->
ctx
->
pb
=
&
v
->
pb
;
v
->
ctx
->
pb
=
&
v
->
pb
;
v
->
ctx
->
io_open
=
nested_io_open
;
v
->
stream_offset
=
stream_offset
;
v
->
stream_offset
=
stream_offset
;
ret
=
avformat_open_input
(
&
v
->
ctx
,
v
->
segments
[
0
]
->
url
,
in_fmt
,
NULL
);
ret
=
avformat_open_input
(
&
v
->
ctx
,
v
->
segments
[
0
]
->
url
,
in_fmt
,
NULL
);
if
(
ret
<
0
)
if
(
ret
<
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment