[vlc-devel] [PATCH 1/2] libvlc: deactivate the playlist before destroying the preparser

Thomas Guillem thomas at gllm.fr
Wed Aug 24 19:01:45 CEST 2016



On Tue, Aug 23, 2016, at 11:32, remi at remlab.net wrote:
> Hello,
> Le 23 août 2016 15:45, Thomas Guillem <thomas at gllm.fr> a écrit :
>  >
>  > This fixes a use-after-free when the art fetcher was triggering a
>  > callback
>  > registered by the playlist (that was destroyed).
>  >
>  > This partially reverts 17bd88b915188d1659ec46c07aa1efd3745071b5
>  > that is a
>  > revert of 9e9b227443831d8c9798b78122a2194053f2b2f1.
>  >
>  > Fixes #17087
>  > ---
>  > src/libvlc.c | 11 ++++++++---
>  > 1 file changed, 8 insertions(+), 3 deletions(-)
>  >
>  > diff --git a/src/libvlc.c b/src/libvlc.c
>  > index 48c2b8c..8bd736c 100644
>  > --- a/src/libvlc.c
>  > +++ b/src/libvlc.c
>  > @@ -508,6 +508,14 @@ void libvlc_InternalCleanup( libvlc_int_t
>  > *p_libvlc )
>  > {
>  >      libvlc_priv_t *priv = libvlc_priv (p_libvlc);
>  >
>  > +    /* Deactivate the playlist before deleting the preparser in
>  >      order to
>  > +     * prevent new preparser requests from the playlist */
>  > +    if (priv->playlist)
>  > +        playlist_Deactivate(priv->playlist);
>  > +
>  > +    if (priv->parser != NULL)
>  > +        playlist_preparser_Delete(priv->parser);
> I think we cannot assume that the preparser won't be used until all
> interfaces, VLM, Libvlc media players and playlist are all gone. And
> that seems unwarranted here.

In that case we need to split it up into 1) deactivate playlist 2)
destroy interfaces (but not the playlist) 3) delete the preparser 4)
delete the playlist (idea from filip).

> > +
>  >      /* Ask the interfaces to stop and destroy them */
>  >      msg_Dbg( p_libvlc, "removing all interfaces" );
>  >      libvlc_Quit( p_libvlc );
>  > @@ -536,9 +544,6 @@ void libvlc_InternalCleanup( libvlc_int_t
>  > *p_libvlc )
>  >      }
>  > #endif
>  >
>  > -    if (priv->parser != NULL)
>  > -        playlist_preparser_Delete(priv->parser);
>  > -
>  >      vlc_DeinitActions( p_libvlc, priv->actions );
>  >
>  >      /* Save the configuration */
>  > --
>  > 2.8.1
>  >
>  > _______________________________________________
>  > vlc-devel mailing list
>  > To unsubscribe or modify your subscription options:
>  > https://mailman.videolan.org/listinfo/vlc-devel
> _________________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20160824/3bd39ef4/attachment.html>


More information about the vlc-devel mailing list