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
52b9575d
Commit
52b9575d
authored
Nov 12, 2017
by
Carl Eugen Hoyos
Committed by
Steven Liu
Nov 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/dashdec: Fix several memleaks.
parent
56960ed9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
dashdec.c
libavformat/dashdec.c
+13
-9
No files found.
libavformat/dashdec.c
View file @
52b9575d
...
@@ -328,17 +328,17 @@ static void free_representation(struct representation *pls)
...
@@ -328,17 +328,17 @@ static void free_representation(struct representation *pls)
}
}
av_freep
(
&
pls
->
url_template
);
av_freep
(
&
pls
->
url_template
);
av_freep
(
pls
);
av_freep
(
&
pls
);
}
}
static
void
set_httpheader_options
(
DASHContext
*
c
,
AVDictionary
*
opts
)
static
void
set_httpheader_options
(
DASHContext
*
c
,
AVDictionary
*
*
opts
)
{
{
// broker prior HTTP options that should be consistent across requests
// broker prior HTTP options that should be consistent across requests
av_dict_set
(
&
opts
,
"user-agent"
,
c
->
user_agent
,
0
);
av_dict_set
(
opts
,
"user-agent"
,
c
->
user_agent
,
0
);
av_dict_set
(
&
opts
,
"cookies"
,
c
->
cookies
,
0
);
av_dict_set
(
opts
,
"cookies"
,
c
->
cookies
,
0
);
av_dict_set
(
&
opts
,
"headers"
,
c
->
headers
,
0
);
av_dict_set
(
opts
,
"headers"
,
c
->
headers
,
0
);
if
(
c
->
is_live
)
{
if
(
c
->
is_live
)
{
av_dict_set
(
&
opts
,
"seekable"
,
"0"
,
0
);
av_dict_set
(
opts
,
"seekable"
,
"0"
,
0
);
}
}
}
}
static
void
update_options
(
char
**
dest
,
const
char
*
name
,
void
*
src
)
static
void
update_options
(
char
**
dest
,
const
char
*
name
,
void
*
src
)
...
@@ -885,7 +885,7 @@ static int parse_manifest(AVFormatContext *s, const char *url, AVIOContext *in)
...
@@ -885,7 +885,7 @@ static int parse_manifest(AVFormatContext *s, const char *url, AVIOContext *in)
if
(
!
in
)
{
if
(
!
in
)
{
close_in
=
1
;
close_in
=
1
;
set_httpheader_options
(
c
,
opts
);
set_httpheader_options
(
c
,
&
opts
);
ret
=
avio_open2
(
&
in
,
url
,
AVIO_FLAG_READ
,
c
->
interrupt_callback
,
&
opts
);
ret
=
avio_open2
(
&
in
,
url
,
AVIO_FLAG_READ
,
c
->
interrupt_callback
,
&
opts
);
av_dict_free
(
&
opts
);
av_dict_free
(
&
opts
);
if
(
ret
<
0
)
if
(
ret
<
0
)
...
@@ -1301,7 +1301,7 @@ static int open_input(DASHContext *c, struct representation *pls, struct fragmen
...
@@ -1301,7 +1301,7 @@ static int open_input(DASHContext *c, struct representation *pls, struct fragmen
char
url
[
MAX_URL_SIZE
];
char
url
[
MAX_URL_SIZE
];
int
ret
;
int
ret
;
set_httpheader_options
(
c
,
opts
);
set_httpheader_options
(
c
,
&
opts
);
if
(
seg
->
size
>=
0
)
{
if
(
seg
->
size
>=
0
)
{
/* try to restrict the HTTP request to the part we want
/* try to restrict the HTTP request to the part we want
* (if this is in fact a HTTP request) */
* (if this is in fact a HTTP request) */
...
@@ -1465,8 +1465,12 @@ static int save_avio_options(AVFormatContext *s)
...
@@ -1465,8 +1465,12 @@ static int save_avio_options(AVFormatContext *s)
if
(
av_opt_get
(
s
->
pb
,
*
opt
,
AV_OPT_SEARCH_CHILDREN
,
&
buf
)
>=
0
)
{
if
(
av_opt_get
(
s
->
pb
,
*
opt
,
AV_OPT_SEARCH_CHILDREN
,
&
buf
)
>=
0
)
{
if
(
buf
[
0
]
!=
'\0'
)
{
if
(
buf
[
0
]
!=
'\0'
)
{
ret
=
av_dict_set
(
&
c
->
avio_opts
,
*
opt
,
buf
,
AV_DICT_DONT_STRDUP_VAL
);
ret
=
av_dict_set
(
&
c
->
avio_opts
,
*
opt
,
buf
,
AV_DICT_DONT_STRDUP_VAL
);
if
(
ret
<
0
)
if
(
ret
<
0
)
{
av_freep
(
&
buf
);
return
ret
;
return
ret
;
}
}
else
{
av_freep
(
&
buf
);
}
}
}
}
opt
++
;
opt
++
;
...
...
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