[MPlayer-cvslog] r33873 - trunk/gui/ui/gtk/preferences.c

ib subversion at mplayerhq.hu
Mon Jul 11 14:32:03 CEST 2011


Author: ib
Date: Mon Jul 11 14:32:03 2011
New Revision: 33873

Log:
Fix segmentation fault.

In case a subtitle codepage or subtitle font encoding is given that does
not match any of the encodings the GUI knows about, the preferences dialog
crashes.

Modified:
   trunk/gui/ui/gtk/preferences.c

Modified: trunk/gui/ui/gtk/preferences.c
==============================================================================
--- trunk/gui/ui/gtk/preferences.c	Mon Jul 11 13:19:44 2011	(r33872)
+++ trunk/gui/ui/gtk/preferences.c	Mon Jul 11 14:32:03 2011	(r33873)
@@ -177,8 +177,6 @@ static struct
   { "cp874",       MSGTR_PREFERENCES_FontEncoding20 },
   { NULL,NULL }
  };
-char * lCEncoding = NULL;
-char * lSEncoding = NULL;
 #endif
 
 static int    old_audio_driver = 0;
@@ -324,8 +322,7 @@ void ShowPreferences( void )
    int i;
    for ( i=0;lEncoding[i].name;i++ )
     if ( !gstrcmp( sub_cp,lEncoding[i].name ) ) break;
-   if ( lEncoding[i].name ) lSEncoding=lEncoding[i].comment;
-   gtk_entry_set_text( GTK_ENTRY( ESubEncoding ),lSEncoding );
+   if ( lEncoding[i].name ) gtk_entry_set_text( GTK_ENTRY( ESubEncoding ),lEncoding[i].comment );
   }
 #endif
 
@@ -344,8 +341,7 @@ void ShowPreferences( void )
    int i;
    for ( i=0;lEncoding[i].name;i++ )
     if ( !gstrcmp( subtitle_font_encoding,lEncoding[i].name ) ) break;
-   if ( lEncoding[i].name ) lCEncoding=lEncoding[i].comment;
-   gtk_entry_set_text( GTK_ENTRY( EFontEncoding ),lCEncoding );
+   if ( lEncoding[i].name ) gtk_entry_set_text( GTK_ENTRY( EFontEncoding ),lEncoding[i].comment );
   }
  switch ( subtitle_autoscale )
   {


More information about the MPlayer-cvslog mailing list