On 06/03/15 11:31, Martin Storsjö wrote:
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);
Might be better do
stts_entries = NULL;
if (track->entry) {
alloc & bail
}
lu
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel