[FFmpeg-devel] [PATCH] avformat/movenc: Fix potential leak of sgpd_entries array.

Matthew Gregan kinetik at flim.org
Wed Apr 12 05:12:17 EEST 2017



Signed-off-by: Matthew Gregan <kinetik at flim.org>
---
 libavformat/movenc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index e6a70bffc0..e6e2313c53 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -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 */
-- 
2.12.2



More information about the ffmpeg-devel mailing list