]> git.sesse.net Git - vlc/commitdiff
skins2: skins2 interface cannot be used if no playlist is available
authorErwan Tulou <erwan10@videolan.org>
Sat, 19 Sep 2009 16:09:46 +0000 (18:09 +0200)
committerErwan Tulou <erwan10@videolan.org>
Sat, 19 Sep 2009 16:20:23 +0000 (18:20 +0200)
Better not start skins2 at all than crash later on, since playlist is taken for granted throughout the code.

modules/gui/skins2/src/skin_main.cpp

index 4c6bbbc5e5d10972243cc5881003aef95efcdf92..6aa0e4782d891849bfe3081b6d1352eb4f8529e4 100644 (file)
@@ -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;
+    }
 
     // Initialize "singleton" objects
     p_intf->p_sys->p_logger = NULL;