avformat/movenc: Fix stts_entries allocation check

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-02-17 21:51:35 +01:00
parent 80c5dc5610
commit 95165f7c1b
1 changed files with 1 additions and 1 deletions

View File

@ -1833,7 +1833,7 @@ static int mov_write_stts_tag(AVIOContext *pb, MOVTrack *track)
stts_entries = track->entry ?
av_malloc_array(track->entry, sizeof(*stts_entries)) : /* worst case */
NULL;
if (!stts_entries)
if (track->entry && !stts_entries)
return AVERROR(ENOMEM);
for (i = 0; i < track->entry; i++) {
int duration = get_cluster_duration(track, i);