aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-06-08 15:19:46 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-08 15:26:03 +0200
commit7c3af60016e6dceabef0c0e24e6543e58c0ca122 (patch)
treeb9ed02c758b9791a94274df53092684beaa1da7c
parentee5145c05d4cfe6443301f9c349af6fe1bd0b57b (diff)
downloadffmpeg-7c3af60016e6dceabef0c0e24e6543e58c0ca122.tar.gz
avformat/movenc: use av_malloc(z)_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/movenc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 7991ada384..55c7e523e9 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -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);