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
a963fdb0
Commit
a963fdb0
authored
Dec 12, 2014
by
wm4
Committed by
Michael Niedermayer
Dec 12, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavu/dict: check for malloc failures
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
a66893ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
dict.c
libavutil/dict.c
+5
-1
No files found.
libavutil/dict.c
View file @
a963fdb0
...
@@ -75,6 +75,8 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value,
...
@@ -75,6 +75,8 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value,
if
(
!
m
)
if
(
!
m
)
m
=
*
pm
=
av_mallocz
(
sizeof
(
*
m
));
m
=
*
pm
=
av_mallocz
(
sizeof
(
*
m
));
if
(
!
m
)
goto
err_out
;
if
(
tag
)
{
if
(
tag
)
{
if
(
flags
&
AV_DICT_DONT_OVERWRITE
)
{
if
(
flags
&
AV_DICT_DONT_OVERWRITE
)
{
...
@@ -100,6 +102,8 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value,
...
@@ -100,6 +102,8 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value,
m
->
elems
[
m
->
count
].
key
=
(
char
*
)(
intptr_t
)
key
;
m
->
elems
[
m
->
count
].
key
=
(
char
*
)(
intptr_t
)
key
;
else
else
m
->
elems
[
m
->
count
].
key
=
av_strdup
(
key
);
m
->
elems
[
m
->
count
].
key
=
av_strdup
(
key
);
if
(
!
m
->
elems
[
m
->
count
].
key
)
goto
err_out
;
if
(
flags
&
AV_DICT_DONT_STRDUP_VAL
)
{
if
(
flags
&
AV_DICT_DONT_STRDUP_VAL
)
{
m
->
elems
[
m
->
count
].
value
=
(
char
*
)(
intptr_t
)
value
;
m
->
elems
[
m
->
count
].
value
=
(
char
*
)(
intptr_t
)
value
;
}
else
if
(
oldval
&&
flags
&
AV_DICT_APPEND
)
{
}
else
if
(
oldval
&&
flags
&
AV_DICT_APPEND
)
{
...
@@ -123,7 +127,7 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value,
...
@@ -123,7 +127,7 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value,
return
0
;
return
0
;
err_out:
err_out:
if
(
!
m
->
count
)
{
if
(
m
&&
!
m
->
count
)
{
av_free
(
m
->
elems
);
av_free
(
m
->
elems
);
av_freep
(
pm
);
av_freep
(
pm
);
}
}
...
...
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