[FFmpeg-cvslog] r22120 - in trunk/libavformat: nutdec.c nutenc.c

vitor subversion
Sun Feb 28 21:49:21 CET 2010


Author: vitor
Date: Sun Feb 28 21:49:21 2010
New Revision: 22120

Log:
Plug some memory leaks in NUT muxer and demuxer

Modified:
   trunk/libavformat/nutdec.c
   trunk/libavformat/nutenc.c

Modified: trunk/libavformat/nutdec.c
==============================================================================
--- trunk/libavformat/nutdec.c	Sun Feb 28 21:48:42 2010	(r22119)
+++ trunk/libavformat/nutdec.c	Sun Feb 28 21:49:21 2010	(r22120)
@@ -897,9 +897,13 @@ static int read_seek(AVFormatContext *s,
 static int nut_read_close(AVFormatContext *s)
 {
     NUTContext *nut = s->priv_data;
+    int i;
 
     av_freep(&nut->time_base);
     av_freep(&nut->stream);
+    av_tree_destroy_free_elem(nut->syncpoints);
+    for(i = 1; i < nut->header_count; i++)
+        av_freep(&nut->header[i]);
 
     return 0;
 }

Modified: trunk/libavformat/nutenc.c
==============================================================================
--- trunk/libavformat/nutenc.c	Sun Feb 28 21:48:42 2010	(r22119)
+++ trunk/libavformat/nutenc.c	Sun Feb 28 21:49:21 2010	(r22120)
@@ -797,6 +797,9 @@ static int write_trailer(AVFormatContext
     while(nut->header_count<3)
         write_headers(nut, bc);
     put_flush_packet(bc);
+    av_freep(&nut->stream);
+    av_freep(&nut->time_base);
+    av_tree_destroy_free_elem(nut->syncpoints);
 
     return 0;
 }



More information about the ffmpeg-cvslog mailing list