[SCM] libav/experimental: memleak patch by (Gildas Bazin <gbazin at altern dot org>)

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 15:38:53 UTC 2013


The following commit has been merged in the experimental branch:
commit ec7d0d2e9ec9c9e5ed6df5446c11ede90d602928
Author: Gildas Bazin <gbazi at altern.org>
Date:   Thu Jan 8 19:01:16 2004 +0000

    memleak patch by (Gildas Bazin <gbazin at altern dot org>)
    
    Originally committed as revision 2678 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 28e49e3..104f176 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -893,6 +893,8 @@ static int mov_write_trailer(AVFormatContext *s)
             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;
     }
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 2da011a..2ad5aa5 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -214,6 +214,9 @@ void mpegts_close_filter(MpegTSContext *ts, MpegTSFilter *filter)
     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 @@ static int mpegts_read_close(AVFormatContext *s)
     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;
 }
 

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list