avformat/movenc: Fix potential leak of sgpd_entries array.

Signed-off-by: Matthew Gregan <kinetik@flim.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Matthew Gregan 2017-04-12 14:12:17 +12:00 committed by Michael Niedermayer
parent c1616b454d
commit b905ba5bc1

View File

@ -2286,8 +2286,10 @@ static int mov_preroll_write_stbl_atoms(AVIOContext *pb, MOVTrack *track)
}
entries++;
if (!group)
if (!group) {
av_free(sgpd_entries);
return 0;
}
/* Write sgpd tag */
avio_wb32(pb, 24 + (group * 2)); /* size */