[MPlayer-dev-eng] [PATCH] Fix memory leak in libmpdemux/muxer.c

Thierry Foucu tfoucu at gmail.com
Wed May 5 18:29:30 CEST 2010


Hi

$subject

Index: libmpdemux/muxer.c
===================================================================
--- libmpdemux/muxer.c (revision 31137)
+++ libmpdemux/muxer.c (working copy)
@@ -141,6 +141,8 @@
           s->buffer = buf->buffer;
           s->muxer->cont_write_chunk(s, buf->len, buf->flags, buf->dts,
buf->pts);

+          free(buf->buffer);
+
           /* 3. restore saved timer and buffer */
           s->timer = tmp_buf.dts;
           s->buffer = tmp_buf.buffer;
@@ -148,6 +150,7 @@

         free(s->muxer->muxbuf);
         s->muxer->muxbuf_num = 0;
+        s->muxer->muxbuf = NULL;
       }
     }
-------------- next part --------------
Index: libmpdemux/muxer.c
===================================================================
--- libmpdemux/muxer.c	(revision 31137)
+++ libmpdemux/muxer.c	(working copy)
@@ -141,6 +141,8 @@
           s->buffer = buf->buffer;
           s->muxer->cont_write_chunk(s, buf->len, buf->flags, buf->dts, buf->pts);
 
+          free(buf->buffer);
+
           /* 3. restore saved timer and buffer */
           s->timer = tmp_buf.dts;
           s->buffer = tmp_buf.buffer;
@@ -148,6 +150,7 @@
 
         free(s->muxer->muxbuf);
         s->muxer->muxbuf_num = 0;
+        s->muxer->muxbuf = NULL;
       }
     }
 


More information about the MPlayer-dev-eng mailing list