diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-03-06 22:54:41 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-06 22:57:11 +0300 |
commit | 1468ff49dfdeaf8e69cb640a326c95ba049c9c98 (patch) | |
tree | b6f55a90d0d00c15fe8a66bf35987e372a7c3fc5 /libavformat | |
parent | 70082a1e533deed6688938232e6e66abbd62b0fa (diff) | |
parent | 9731cf4001377fa2f75c279072cc2b0cbd57bf8e (diff) |
Merge commit '9731cf4001377fa2f75c279072cc2b0cbd57bf8e'
* commit '9731cf4001377fa2f75c279072cc2b0cbd57bf8e':
movenc: Keep writing zero-entry stts atoms as intended
Conflicts:
libavformat/movenc.c
See: 95165f7c1b533c121b890fa1e82e8ed596cfc108
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/movenc.c | 12 |
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) { |