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
5b911f1d
Commit
5b911f1d
authored
Apr 01, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/webmdashenc: use AVERROR(ENOMEM) for memory allocation failures
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
5b32558f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
webmdashenc.c
libavformat/webmdashenc.c
+6
-3
No files found.
libavformat/webmdashenc.c
View file @
5b911f1d
...
...
@@ -271,7 +271,8 @@ static int to_integer(char *p, int len)
{
int
ret
;
char
*
q
=
av_malloc
(
sizeof
(
char
)
*
len
);
if
(
!
q
)
return
-
1
;
if
(
!
q
)
return
AVERROR
(
ENOMEM
);
av_strlcpy
(
q
,
p
,
len
);
ret
=
atoi
(
q
);
av_free
(
q
);
...
...
@@ -291,7 +292,8 @@ static int parse_adaptation_sets(AVFormatContext *s)
continue
;
else
if
(
state
==
new_set
&&
!
strncmp
(
p
,
"id="
,
3
))
{
w
->
as
=
av_realloc
(
w
->
as
,
sizeof
(
*
w
->
as
)
*
++
w
->
nb_as
);
if
(
w
->
as
==
NULL
)
return
-
1
;
if
(
w
->
as
==
NULL
)
return
AVERROR
(
ENOMEM
);
w
->
as
[
w
->
nb_as
-
1
].
nb_streams
=
0
;
w
->
as
[
w
->
nb_as
-
1
].
streams
=
NULL
;
p
+=
3
;
// consume "id="
...
...
@@ -308,7 +310,8 @@ static int parse_adaptation_sets(AVFormatContext *s)
q
=
p
;
while
(
*
q
!=
'\0'
&&
*
q
!=
','
&&
*
q
!=
' '
)
q
++
;
as
->
streams
=
av_realloc
(
as
->
streams
,
sizeof
(
*
as
->
streams
)
*
++
as
->
nb_streams
);
if
(
as
->
streams
==
NULL
)
return
-
1
;
if
(
as
->
streams
==
NULL
)
return
AVERROR
(
ENOMEM
);
as
->
streams
[
as
->
nb_streams
-
1
]
=
to_integer
(
p
,
q
-
p
+
1
);
if
(
as
->
streams
[
as
->
nb_streams
-
1
]
<
0
)
return
-
1
;
if
(
*
q
==
'\0'
)
break
;
...
...
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