changeset 4390:5b0645175029 libavformat

Fix minor memory leak. Patch by Jindrich Makovicka, approved by mans.
author michael
date Fri, 06 Feb 2009 20:30:18 +0000
parents 25430a31705d
children 3c0d674bd232
files mpegts.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mpegts.c	Fri Feb 06 15:30:41 2009 +0000
+++ b/mpegts.c	Fri Feb 06 20:30:18 2009 +0000
@@ -334,6 +334,13 @@
     pid = filter->pid;
     if (filter->type == MPEGTS_SECTION)
         av_freep(&filter->u.section_filter.section_buf);
+    else if (filter->type == MPEGTS_PES) {
+        /* referenced private data will be freed later in
+         * av_close_input_stream */
+        if (!((PESContext *)filter->u.pes_filter.opaque)->st) {
+            av_freep(&filter->u.pes_filter.opaque);
+        }
+    }
 
     av_free(filter);
     ts->pids[pid] = NULL;