mirror of
https://github.com/mpv-player/mpv
synced 2024-12-20 05:42:19 +00:00
fix segfault in the skin browser when sbSelectedSkin gets dereferenced before setting, when no skin is selected in the skin list upon opening the browser,
and "Cancel" or "OK" buttons get clicked. Noticed when runnig freshly compiled gmplayer on a system where the skins were still under the old location. based on a combined patch by Stanislav Maslovski <stanislav POIS maslovski AH gmail POIS com> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18067 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
b2360d8174
commit
c93f360e3d
@ -24,8 +24,8 @@ char * sbMPlayerDirInHome_obsolete=NULL;
|
||||
char * sbMPlayerPrefixDir=NULL;
|
||||
char * sbMPlayerPrefixDir_obsolete=NULL;
|
||||
|
||||
char * gtkOldSkin;
|
||||
static char * prev;
|
||||
char * gtkOldSkin=NULL;
|
||||
static char * prev=NULL;
|
||||
|
||||
GtkWidget * SkinBrowser = NULL;
|
||||
|
||||
@ -77,9 +77,11 @@ int gtkFillSkinList( gchar * mdir )
|
||||
|
||||
static void prButton( GtkObject * object,gpointer user_data )
|
||||
{
|
||||
switch ( (int)user_data )
|
||||
{
|
||||
case 0: // cancel
|
||||
if ( sbSelectedSkin )
|
||||
{
|
||||
switch ( (int)user_data )
|
||||
{
|
||||
case 0: // cancel
|
||||
if ( strcmp( sbSelectedSkin,gtkOldSkin ) ) ChangeSkin( gtkOldSkin );
|
||||
break;
|
||||
case 1: // ok
|
||||
@ -88,6 +90,7 @@ static void prButton( GtkObject * object,gpointer user_data )
|
||||
skinName=strdup( sbSelectedSkin );
|
||||
break;
|
||||
}
|
||||
}
|
||||
HideSkinBrowser();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user