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
7c3af600
Commit
7c3af600
authored
Jun 08, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/movenc: use av_malloc(z)_array()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
ee5145c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
movenc.c
libavformat/movenc.c
+3
-3
No files found.
libavformat/movenc.c
View file @
7c3af600
...
...
@@ -1381,7 +1381,7 @@ static int mov_write_ctts_tag(AVIOContext *pb, MOVTrack *track)
uint32_t
atom_size
;
int
i
;
ctts_entries
=
av_malloc
((
track
->
entry
+
1
)
*
sizeof
(
*
ctts_entries
));
/* worst case */
ctts_entries
=
av_malloc
_array
((
track
->
entry
+
1
),
sizeof
(
*
ctts_entries
));
/* worst case */
ctts_entries
[
0
].
count
=
1
;
ctts_entries
[
0
].
duration
=
track
->
cluster
[
0
].
cts
;
for
(
i
=
1
;
i
<
track
->
entry
;
i
++
)
{
...
...
@@ -1422,7 +1422,7 @@ static int mov_write_stts_tag(AVIOContext *pb, MOVTrack *track)
entries
=
1
;
}
else
{
stts_entries
=
track
->
entry
?
av_malloc
(
track
->
entry
*
sizeof
(
*
stts_entries
))
:
/* worst case */
av_malloc
_array
(
track
->
entry
,
sizeof
(
*
stts_entries
))
:
/* worst case */
NULL
;
for
(
i
=
0
;
i
<
track
->
entry
;
i
++
)
{
int
duration
=
get_cluster_duration
(
track
,
i
);
...
...
@@ -3987,7 +3987,7 @@ static int mov_write_header(AVFormatContext *s)
// Reserve an extra stream for chapters for the case where chapters
// are written in the trailer
mov
->
tracks
=
av_mallocz
((
mov
->
nb_streams
+
1
)
*
sizeof
(
*
mov
->
tracks
));
mov
->
tracks
=
av_mallocz
_array
((
mov
->
nb_streams
+
1
),
sizeof
(
*
mov
->
tracks
));
if
(
!
mov
->
tracks
)
return
AVERROR
(
ENOMEM
);
...
...
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