[MPlayer-cvslog] CVS: main/Gui/mplayer/gtk sb.c,1.19,1.20

Guillaume Poirier CVS syncmail at mplayerhq.hu
Sun Apr 9 15:52:48 CEST 2006


CVS change done by Guillaume Poirier CVS

Update of /cvsroot/mplayer/main/Gui/mplayer/gtk
In directory mail:/var2/tmp/cvs-serv5714/Gui/mplayer/gtk

Modified Files:
	sb.c 
Log Message:
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>


Index: sb.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/gtk/sb.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- sb.c	27 Mar 2006 11:39:26 -0000	1.19
+++ sb.c	9 Apr 2006 13:52:45 -0000	1.20
@@ -24,8 +24,8 @@
 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 @@
 
 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 @@
 	skinName=strdup( sbSelectedSkin );
 	break;   
   }
+ }
  HideSkinBrowser();
 }
 




More information about the MPlayer-cvslog mailing list