[FFmpeg-cvslog] movenc: Keep writing zero-entry stts atoms as intended
Martin Storsjö
git at videolan.org
Fri Mar 6 21:07:36 CET 2015
ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Fri Mar 6 12:27:14 2015 +0200| [9731cf4001377fa2f75c279072cc2b0cbd57bf8e] | committer: Martin Storsjö
movenc: Keep writing zero-entry stts atoms as intended
a876585215 had the unintended side effect of returning AVERROR(ENOMEM)
when track->entry is zero, while the code intentionally wants to
continue in that case.
Signed-off-by: Martin Storsjö <martin at martin.st>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9731cf4001377fa2f75c279072cc2b0cbd57bf8e
---
libavformat/movenc.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 585b080..343f321 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1197,7 +1197,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;
@@ -1210,11 +1210,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(track->entry * sizeof(*stts_entries)) : /* worst case */
- NULL;
- if (!stts_entries)
- return AVERROR(ENOMEM);
+ if (track->entry) {
+ stts_entries = av_malloc(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) {
More information about the ffmpeg-cvslog
mailing list