diff mbox

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

Message ID 20170412021217.GA31166@brak.lan
State Accepted
Commit b905ba5bc18c89c7fccd8621795755644442ef19
Headers show

Commit Message

Matthew Gregan April 12, 2017, 2:12 a.m. UTC
Signed-off-by: Matthew Gregan <kinetik@flim.org>
---
 libavformat/movenc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Michael Niedermayer April 12, 2017, 8:45 p.m. UTC | #1
On Wed, Apr 12, 2017 at 02:12:17PM +1200, Matthew Gregan wrote:
> 
> 
> Signed-off-by: Matthew Gregan <kinetik@flim.org>
> ---
>  libavformat/movenc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

applied

thx

[...]
diff mbox

Patch

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 */