[FFmpeg-devel] about issue 430 (memory leak in MPEG TS parser)

Michael Niedermayer michaelni
Thu Apr 24 23:55:43 CEST 2008


On Thu, Apr 24, 2008 at 05:12:58PM +0400, Vladimir Eremeev wrote:
> Dear all.
> I have uploaded the sample mpeg TS file and the sample program, showing
> memory leak in the MPEG TS parser, in addition to the already reported issue 430 
> 
> ( https://roundup.mplayerhq.hu/roundup/ffmpeg/issue430 )
> 
> Uploaded files:
> 
> upload.mplayerhq.hu/MPlayer/incoming/issue430_wl2776/description.txt
>            description of steps performed and results. This file also contains the C source.
> 
> upload.mplayerhq.hu/MPlayer/incoming/issue430_wl2776/issue430_wl2776_dump.ts
>            dump of the MPEG 2 transport stream, obtained with the command
>             dd if=/dev/asirx0 of=issue430_wl2776_dump.ts bs=1024 count=10000

Patch to fix 2 leaks which i found is below,
ill apply it it 24h unless mans objects.

Index: libavformat/mpegts.c
===================================================================
--- libavformat/mpegts.c	(revision 12932)
+++ libavformat/mpegts.c	(working copy)
@@ -767,6 +767,8 @@
                     if(program)
                         av_set_program_name(program, provider_name, name);
                 }
+                av_free(name);
+                av_free(provider_name);
                 break;
             default:
                 break;
@@ -1370,6 +1372,9 @@
 {
     MpegTSContext *ts = s->priv_data;
     int i;
+
+    clear_programs(ts);
+
     for(i=0;i<NB_PID_MAX;i++)
         if (ts->pids[i]) mpegts_close_filter(ts, ts->pids[i]);
 
[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080424/f4565085/attachment.pgp>



More information about the ffmpeg-devel mailing list