[vlc-devel] [PATCH 1/2] asf: Fix leak on duplicated stream ids

Francois Cartegnie fcvlcdev at free.fr
Mon Aug 12 12:19:03 CEST 2019


Le 12/08/2019 à 12:09, Hugo Beauzée-Luyssen a écrit :
> ---
>  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;
> 

I would do the opposite and ignore duplicated ones instead.

-- 
Francois Cartegnie
VideoLAN - VLC Developer


More information about the vlc-devel mailing list