[vlc-devel] commit: skins2: skins2 interface cannot be used if no playlist is available (Erwan Tulou )

Laurent Aimar fenrir at via.ecp.fr
Sat Sep 19 21:55:21 CEST 2009


Hi,

On Sat, Sep 19, 2009, git version control wrote:
> skins2: skins2 interface cannot be used if no playlist is available
> 
> Better not start skins2 at all than crash later on, since playlist is taken for granted throughout the code.
> 
> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=18a12248f635ac599ee7f13087600c2b3d918615
> ---
> 
>  modules/gui/skins2/src/skin_main.cpp |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/modules/gui/skins2/src/skin_main.cpp b/modules/gui/skins2/src/skin_main.cpp
> index 4c6bbbc..6aa0e47 100644
> --- a/modules/gui/skins2/src/skin_main.cpp
> +++ b/modules/gui/skins2/src/skin_main.cpp
> @@ -106,6 +106,11 @@ static int Open( vlc_object_t *p_this )
>  
>      p_intf->p_sys->p_input = NULL;
>      p_intf->p_sys->p_playlist = pl_Hold( p_intf );
> +    if( !p_intf->p_sys->p_playlist )
> +    {
> +        free( p_intf->p_sys );
> +        return VLC_EGENERIC;
> +    }
 In fact, you could even abort/assert here. VLC core will not continue
if the playlist creation have failed.
 By design, pl_Hold cannot failed while an interface (launched by the core)
is alive (for 1.x at least).

-- 
fenrir



More information about the vlc-devel mailing list