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
d290bb0c
Commit
d290bb0c
authored
Nov 17, 2018
by
Andrey Semashev
Committed by
Karthick J
Nov 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/dashenc: Fix AVDictionary leaks in case of various init errors.
parent
281a21ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
dashenc.c
libavformat/dashenc.c
+7
-6
No files found.
libavformat/dashenc.c
View file @
d290bb0c
...
...
@@ -833,12 +833,12 @@ static int write_manifest(AVFormatContext *s, int final)
snprintf
(
temp_filename
,
sizeof
(
temp_filename
),
use_rename
?
"%s.tmp"
:
"%s"
,
s
->
url
);
set_http_options
(
&
opts
,
c
);
ret
=
dashenc_io_open
(
s
,
&
c
->
mpd_out
,
temp_filename
,
&
opts
);
av_dict_free
(
&
opts
);
if
(
ret
<
0
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Unable to open %s for writing
\n
"
,
temp_filename
);
return
ret
;
}
out
=
c
->
mpd_out
;
av_dict_free
(
&
opts
);
avio_printf
(
out
,
"<?xml version=
\"
1.0
\"
encoding=
\"
utf-8
\"
?>
\n
"
);
avio_printf
(
out
,
"<MPD xmlns:xsi=
\"
http://www.w3.org/2001/XMLSchema-instance
\"\n
"
"
\t
xmlns=
\"
urn:mpeg:dash:schema:mpd:2011
\"\n
"
...
...
@@ -924,11 +924,11 @@ static int write_manifest(AVFormatContext *s, int final)
set_http_options
(
&
opts
,
c
);
ret
=
dashenc_io_open
(
s
,
&
c
->
m3u8_out
,
temp_filename
,
&
opts
);
av_dict_free
(
&
opts
);
if
(
ret
<
0
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Unable to open %s for writing
\n
"
,
temp_filename
);
return
ret
;
}
av_dict_free
(
&
opts
);
ff_hls_write_playlist_version
(
c
->
m3u8_out
,
7
);
...
...
@@ -1122,9 +1122,9 @@ static int dash_init(AVFormatContext *s)
snprintf
(
filename
,
sizeof
(
filename
),
"%s%s"
,
c
->
dirname
,
os
->
initfile
);
set_http_options
(
&
opts
,
c
);
ret
=
s
->
io_open
(
s
,
&
os
->
out
,
filename
,
AVIO_FLAG_WRITE
,
&
opts
);
av_dict_free
(
&
opts
);
if
(
ret
<
0
)
return
ret
;
av_dict_free
(
&
opts
);
os
->
init_start_pos
=
0
;
if
(
c
->
format_options_str
)
{
...
...
@@ -1145,11 +1145,12 @@ static int dash_init(AVFormatContext *s)
av_dict_set_int
(
&
opts
,
"dash_track_number"
,
i
+
1
,
0
);
av_dict_set_int
(
&
opts
,
"live"
,
1
,
0
);
}
if
((
ret
=
avformat_init_output
(
ctx
,
&
opts
))
<
0
)
ret
=
avformat_init_output
(
ctx
,
&
opts
);
av_dict_free
(
&
opts
);
if
(
ret
<
0
)
return
ret
;
os
->
ctx_inited
=
1
;
avio_flush
(
ctx
->
pb
);
av_dict_free
(
&
opts
);
av_log
(
s
,
AV_LOG_VERBOSE
,
"Representation %d init segment will be written to: %s
\n
"
,
i
,
filename
);
...
...
@@ -1553,9 +1554,9 @@ static int dash_write_packet(AVFormatContext *s, AVPacket *pkt)
use_rename
?
"%s.tmp"
:
"%s"
,
os
->
full_path
);
set_http_options
(
&
opts
,
c
);
ret
=
dashenc_io_open
(
s
,
&
os
->
out
,
os
->
temp_path
,
&
opts
);
av_dict_free
(
&
opts
);
if
(
ret
<
0
)
return
ret
;
av_dict_free
(
&
opts
);
}
//write out the data immediately in streaming mode
...
...
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