From dcd913d9ed6c15ea53882894baa343695575abcd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jind=C5=99ich=20Makovi=C4=8Dka?= Date: Fri, 6 Feb 2009 20:30:18 +0000 Subject: [PATCH] Fix minor memory leak. Patch by Jindrich Makovicka, approved by mans. Originally committed as revision 17021 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/mpegts.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index e335bc6..248a35f 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -334,6 +334,13 @@ static 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) { + /* 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; -- 2.7.4