[vlc-devel] [PATCH 1/2] asf: Fix leak on duplicated stream ids
Hugo Beauzée-Luyssen
hugo at beauzee.fr
Mon Aug 12 12:09:53 CEST 2019
---
modules/demux/asf/asf.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c
index d9f359fcd3..62e14195d4 100644
--- a/modules/demux/asf/asf.c
+++ b/modules/demux/asf/asf.c
@@ -873,6 +873,19 @@ static int DemuxInit( demux_t *p_demux )
i_stream );
p_esp = NULL;
+ if (p_sys->track[p_sp->i_stream_number])
+ {
+ if( p_sys->track[p_sp->i_stream_number]->p_es )
+ {
+ es_out_Del( p_demux->out, p_sys->track[p_sp->i_stream_number]->p_es );
+ }
+ if ( p_sys->track[p_sp->i_stream_number]->p_fmt )
+ {
+ es_format_Clean( p_sys->track[p_sp->i_stream_number]->p_fmt );
+ free( p_sys->track[p_sp->i_stream_number]->p_fmt );
+ }
+ free(p_sys->track[p_sp->i_stream_number]);
+ }
tk = p_sys->track[p_sp->i_stream_number] = malloc( sizeof( asf_track_t ) );
if (!tk)
goto error;
--
2.20.1
More information about the vlc-devel
mailing list