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.
---
 libavformat/movenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 7fec227..d4ab17f 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1213,7 +1213,7 @@ static int mov_write_stts_tag(AVIOContext *pb, MOVTrack 
*track)
         stts_entries = track->entry ?
                        av_malloc(track->entry * sizeof(*stts_entries)) : /* 
worst case */
                        NULL;
-        if (!stts_entries)
+        if (!stts_entries && track->entry)
             return AVERROR(ENOMEM);
         for (i = 0; i < track->entry; i++) {
             int duration = get_cluster_duration(track, i);
-- 
1.9.3 (Apple Git-50)

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to