changeset 342:0c1b489c96bf libavformat

memleak patch by (Gildas Bazin <gbazin at altern dot org>)
author michael
date Thu, 08 Jan 2004 19:01:16 +0000
parents ad2a57c5467a
children 538e6791f4c7
files movenc.c mpegts.c
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/movenc.c	Tue Jan 06 15:31:36 2004 +0000
+++ b/movenc.c	Thu Jan 08 19:01:16 2004 +0000
@@ -893,6 +893,8 @@
             av_free(mov->tracks[i].cluster[j]);
         }
         av_free(mov->tracks[i].cluster);
+        if( mov->tracks[i].vosLen ) av_free( mov->tracks[i].vosData );
+
         mov->tracks[i].cluster = NULL;
         mov->tracks[i].ents_allocated = mov->tracks[i].entry = 0;
     }
--- a/mpegts.c	Tue Jan 06 15:31:36 2004 +0000
+++ b/mpegts.c	Thu Jan 08 19:01:16 2004 +0000
@@ -214,6 +214,9 @@
     pid = filter->pid;
     if (filter->type == MPEGTS_SECTION)
         av_freep(&filter->u.section_filter.section_buf);
+    else if (filter->type == MPEGTS_PES)
+        av_freep(&filter->u.pes_filter.opaque);
+
     av_free(filter);
     ts->pids[pid] = NULL;
 }
@@ -1271,7 +1274,7 @@
     MpegTSContext *ts = s->priv_data;
     int i;
     for(i=0;i<NB_PID_MAX;i++)
-        av_free(ts->pids[i]);
+        if (ts->pids[i]) mpegts_close_filter(ts, ts->pids[i]);
     return 0;
 }