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
a27c4127
Commit
a27c4127
authored
Jul 14, 2017
by
Derek Buitenhuis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webmdashenc: Fix memory leak
Signed-off-by:
Derek Buitenhuis
<
derek.buitenhuis@gmail.com
>
parent
ba4beaf6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
8 deletions
+30
-8
webmdashenc.c
libavformat/webmdashenc.c
+30
-8
No files found.
libavformat/webmdashenc.c
View file @
a27c4127
...
...
@@ -288,33 +288,55 @@ static int parse_filename(char *filename, char **representation_id,
char
*
period_pos
=
NULL
;
char
*
temp_pos
=
NULL
;
char
*
filename_str
=
av_strdup
(
filename
);
if
(
!
filename_str
)
return
AVERROR
(
ENOMEM
);
int
ret
=
0
;
if
(
!
filename_str
)
{
ret
=
AVERROR
(
ENOMEM
);
goto
end
;
}
temp_pos
=
av_stristr
(
filename_str
,
"_"
);
while
(
temp_pos
)
{
underscore_pos
=
temp_pos
+
1
;
temp_pos
=
av_stristr
(
temp_pos
+
1
,
"_"
);
}
if
(
!
underscore_pos
)
return
AVERROR_INVALIDDATA
;
if
(
!
underscore_pos
)
{
ret
=
AVERROR_INVALIDDATA
;
goto
end
;
}
period_pos
=
av_stristr
(
underscore_pos
,
"."
);
if
(
!
period_pos
)
return
AVERROR_INVALIDDATA
;
if
(
!
period_pos
)
{
ret
=
AVERROR_INVALIDDATA
;
goto
end
;
}
*
(
underscore_pos
-
1
)
=
0
;
if
(
representation_id
)
{
*
representation_id
=
av_malloc
(
period_pos
-
underscore_pos
+
1
);
if
(
!
(
*
representation_id
))
return
AVERROR
(
ENOMEM
);
if
(
!
(
*
representation_id
))
{
ret
=
AVERROR
(
ENOMEM
);
goto
end
;
}
av_strlcpy
(
*
representation_id
,
underscore_pos
,
period_pos
-
underscore_pos
+
1
);
}
if
(
initialization_pattern
)
{
*
initialization_pattern
=
av_asprintf
(
"%s_$RepresentationID$.hdr"
,
filename_str
);
if
(
!
(
*
initialization_pattern
))
return
AVERROR
(
ENOMEM
);
if
(
!
(
*
initialization_pattern
))
{
ret
=
AVERROR
(
ENOMEM
);
goto
end
;
}
}
if
(
media_pattern
)
{
*
media_pattern
=
av_asprintf
(
"%s_$RepresentationID$_$Number$.chk"
,
filename_str
);
if
(
!
(
*
media_pattern
))
return
AVERROR
(
ENOMEM
);
if
(
!
(
*
media_pattern
))
{
ret
=
AVERROR
(
ENOMEM
);
goto
end
;
}
}
av_free
(
filename_str
);
return
0
;
end:
av_freep
(
&
filename_str
);
return
ret
;
}
/*
...
...
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