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
8ea8be59
Commit
8ea8be59
authored
Apr 26, 2018
by
guikunzhi
Committed by
Steven Liu
Apr 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix memory leak of parsing dash MPD
Signed-off-by:
guikunzhi
<
guikunzhi@163.com
>
parent
1c97035e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
dashdec.c
libavformat/dashdec.c
+11
-3
No files found.
libavformat/dashdec.c
View file @
8ea8be59
...
...
@@ -706,6 +706,7 @@ static int resolve_content_path(AVFormatContext *s, const char *url, int *max_ur
char
*
baseurl
=
NULL
;
char
*
root_url
=
NULL
;
char
*
text
=
NULL
;
char
*
tmp
=
NULL
;
int
isRootHttp
=
0
;
char
token
=
'/'
;
...
...
@@ -735,9 +736,11 @@ static int resolve_content_path(AVFormatContext *s, const char *url, int *max_ur
goto
end
;
}
av_strlcpy
(
text
,
url
,
strlen
(
url
)
+
1
);
while
(
mpdName
=
av_strtok
(
text
,
"/"
,
&
text
))
{
tmp
=
text
;
while
(
mpdName
=
av_strtok
(
tmp
,
"/"
,
&
tmp
))
{
size
=
strlen
(
mpdName
);
}
av_free
(
text
);
path
=
av_mallocz
(
tmp_max_url_size
);
tmp_str
=
av_mallocz
(
tmp_max_url_size
);
...
...
@@ -796,6 +799,7 @@ end:
}
av_free
(
path
);
av_free
(
tmp_str
);
xmlFree
(
baseurl
);
return
updated
;
}
...
...
@@ -1121,6 +1125,7 @@ static int parse_manifest(AVFormatContext *s, const char *url, AVIOContext *in)
xmlNodePtr
root_element
=
NULL
;
xmlNodePtr
node
=
NULL
;
xmlNodePtr
period_node
=
NULL
;
xmlNodePtr
tmp_node
=
NULL
;
xmlNodePtr
mpd_baseurl_node
=
NULL
;
xmlNodePtr
period_baseurl_node
=
NULL
;
xmlNodePtr
period_segmenttemplate_node
=
NULL
;
...
...
@@ -1215,8 +1220,10 @@ static int parse_manifest(AVFormatContext *s, const char *url, AVIOContext *in)
xmlFree
(
val
);
}
mpd_baseurl_node
=
find_child_node_by_name
(
node
,
"BaseURL"
);
if
(
!
mpd_baseurl_node
)
{
tmp_node
=
find_child_node_by_name
(
node
,
"BaseURL"
);
if
(
tmp_node
)
{
mpd_baseurl_node
=
xmlCopyNode
(
tmp_node
,
1
);
}
else
{
mpd_baseurl_node
=
xmlNewNode
(
NULL
,
"BaseURL"
);
}
...
...
@@ -1270,6 +1277,7 @@ cleanup:
/*free the document */
xmlFreeDoc
(
doc
);
xmlCleanupParser
();
xmlFreeNode
(
mpd_baseurl_node
);
}
av_free
(
new_url
);
...
...
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