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
78f680cb
Commit
78f680cb
authored
Sep 16, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/smacker: use av_malloc_array() and check for allocation error
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
7703d19c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
smacker.c
libavformat/smacker.c
+6
-1
No files found.
libavformat/smacker.c
View file @
78f680cb
...
...
@@ -142,8 +142,13 @@ static int smacker_read_header(AVFormatContext *s)
av_log
(
s
,
AV_LOG_ERROR
,
"Too many frames: %i
\n
"
,
smk
->
frames
);
return
AVERROR_INVALIDDATA
;
}
smk
->
frm_size
=
av_malloc
(
smk
->
frames
*
4
);
smk
->
frm_size
=
av_malloc
_array
(
smk
->
frames
,
sizeof
(
*
smk
->
frm_size
)
);
smk
->
frm_flags
=
av_malloc
(
smk
->
frames
);
if
(
!
smk
->
frm_size
||
!
smk
->
frm_flags
)
{
av_freep
(
&
smk
->
frm_size
);
av_freep
(
&
smk
->
frm_flags
);
return
AVERROR
(
ENOMEM
);
}
smk
->
is_ver4
=
(
smk
->
magic
!=
MKTAG
(
'S'
,
'M'
,
'K'
,
'2'
));
...
...
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