Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavformat/movenc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 85b2ea9cf3..68f415035c 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1895,7 +1895,7 @@ static int mov_write_ctts_tag(AVIOContext *pb, MOVTrack *track)
/* Time to sample atom */
static int mov_write_stts_tag(AVIOContext *pb, MOVTrack *track)
{
- MOVStts *stts_entries;
+ MOVStts *stts_entries = NULL;
uint32_t entries = -1;
uint32_t atom_size;
int i;
@@ -1908,11 +1908,11 @@ static int mov_write_stts_tag(AVIOContext *pb, MOVTrack *track)
stts_entries[0].duration = 1;
entries = 1;
} else {
- stts_entries = track->entry ?
- av_malloc_array(track->entry, sizeof(*stts_entries)) : /* worst case */
- NULL;
- if (track->entry && !stts_entries)
- return AVERROR(ENOMEM);
+ if (track->entry) {
+ stts_entries = av_malloc_array(track->entry, sizeof(*stts_entries)); /* worst case */
+ if (!stts_entries)
+ return AVERROR(ENOMEM);
+ }
for (i = 0; i < track->entry; i++) {
int duration = get_cluster_duration(track, i);
if (i && duration == stts_entries[entries].duration) {