summaryrefslogtreecommitdiff
path: root/libavformat/mpegts.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/mpegts.c')
-rw-r--r--libavformat/mpegts.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 2da011a57e..2ad5aa5c76 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;
}