]> git.sesse.net Git - ffmpeg/commitdiff
Plug some memory leaks in NUT muxer and demuxer
authorVitor Sessak <vitor1001@gmail.com>
Sun, 28 Feb 2010 20:49:21 +0000 (20:49 +0000)
committerVitor Sessak <vitor1001@gmail.com>
Sun, 28 Feb 2010 20:49:21 +0000 (20:49 +0000)
Originally committed as revision 22120 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/nutdec.c
libavformat/nutenc.c

index ea2ac865549c3b81f2a55085ac71f15a2f4cac08..8ca59231a8452a236b7129615a8454bd1f3bc78e 100644 (file)
@@ -897,9 +897,13 @@ static int read_seek(AVFormatContext *s, int stream_index, int64_t pts, int flag
 static int nut_read_close(AVFormatContext *s)
 {
     NUTContext *nut = s->priv_data;
 static int nut_read_close(AVFormatContext *s)
 {
     NUTContext *nut = s->priv_data;
+    int i;
 
     av_freep(&nut->time_base);
     av_freep(&nut->stream);
 
     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;
 }
 
     return 0;
 }
index 03d3712638b478393a4f882df609f4188da99edf..8509aa2faa97e1da02bb249f8b824c5a5136e0b2 100644 (file)
@@ -797,6 +797,9 @@ static int write_trailer(AVFormatContext *s){
     while(nut->header_count<3)
         write_headers(nut, bc);
     put_flush_packet(bc);
     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;
 }
 
     return 0;
 }