avformat/movenc: Fix potential leak of sgpd_entries array.
authorMatthew Gregan <kinetik@flim.org>
Wed, 12 Apr 2017 02:12:17 +0000 (14:12 +1200)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 12 Apr 2017 21:12:06 +0000 (23:12 +0200)
Signed-off-by: Matthew Gregan <kinetik@flim.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/movenc.c

index e6a70bf..e6e2313 100644 (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 */