[vlc-devel] [patch] 2nd edition, crash in simple_preferences

Andre Weber WeberAndre at gmx.de
Tue Nov 27 23:44:16 CET 2007


Index: simple_preferences.cpp
===================================================================
--- simple_preferences.cpp (revision 23387)
+++ simple_preferences.cpp (working copy)
@@ -285,19 +285,23 @@
             /* Disk Devices */
             {
                 ui.DVDDevice->setToolTip(
-                    qtr( "If this propriety is blank, then you have\n"
+                    qtr( "If this property is blank, then you have\n"
                          "values for DVD, VCD, and CDDA.\n"
-                         "You can define a unique one or set that in"
+                         "You can define a unique one or set that in\n"
                          "the advanced preferences" ) );
                 char *psz_dvddiscpath = config_GetPsz( p_intf, "dvd" );
                 char *psz_vcddiscpath = config_GetPsz( p_intf, "vcd" );
                 char *psz_cddadiscpath = config_GetPsz( p_intf, "cd-audio" );
-                if( ( *psz_cddadiscpath == *psz_dvddiscpath )
-                   && ( *psz_dvddiscpath == *psz_vcddiscpath ) )
+
+                /* missing null checking produced crash on click... dvd was empty at my site */  
+                if(psz_dvddiscpath && psz_cddadiscpath && psz_cddadiscpath &&
+                   ( *psz_cddadiscpath == *psz_dvddiscpath ) &&
+                   ( *psz_vcddiscpath == *psz_dvddiscpath ) )
                 {
                     ui.DVDDevice->setText( qfu( psz_dvddiscpath ) );
                 }
-                delete psz_cddadiscpath; delete psz_dvddiscpath;
+                delete psz_cddadiscpath; 
+                delete psz_dvddiscpath;
                 delete psz_vcddiscpath;
             }
 




More information about the vlc-devel mailing list