]> git.sesse.net Git - vlc/commitdiff
* opengl: remove NULL from string arrays
authorDerk-Jan Hartman <hartman@videolan.org>
Thu, 7 Oct 2004 22:05:34 +0000 (22:05 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Thu, 7 Oct 2004 22:05:34 +0000 (22:05 +0000)
* configuration.c: don't crash on NULL values

modules/video_output/opengl.c
src/misc/configuration.c

index bcdb044e036c59760640e49f06a1bf2fb9ebd124..44423036b000563bce6778c1fe6983fbfb902115 100644 (file)
@@ -99,9 +99,9 @@ static int SendEvents( vlc_object_t *, char const *,
     "Allows you to select different visual effects.")
 
 static char *ppsz_effects[] = {
-        "none", "cube", "transparent-cube", NULL };
+        "none", "cube", "transparent-cube" };
 static char *ppsz_effects_text[] = {
-        N_("None"), N_("Cube"), N_("Transparent Cube"), NULL };
+        N_("None"), N_("Cube"), N_("Transparent Cube") };
 
 vlc_module_begin();
     set_description( _("OpenGL video output") );
index 305f0998f9429976ab2c0d44273d1efe8229ce45..7ecb49c30b8459e0b74e232b6cd461c9b69e7ff5 100644 (file)
@@ -528,8 +528,8 @@ void config_Duplicate( module_t *p_module, module_config_t *p_orig )
                 if( p_module->p_config[i].ppsz_list )
                 {
                     for( j = 0; j < p_orig[i].i_list; j++ )
-                        p_module->p_config[i].ppsz_list[j] =
-                            strdup( p_orig[i].ppsz_list[j] );
+                        p_module->p_config[i].ppsz_list[j] = p_orig[i].ppsz_list[j] ?
+                            strdup( p_orig[i].ppsz_list[j] ) : NULL ;
                     p_module->p_config[i].ppsz_list[j] = NULL;
                 }
             }
@@ -540,8 +540,8 @@ void config_Duplicate( module_t *p_module, module_config_t *p_orig )
                 if( p_module->p_config[i].ppsz_list_text )
                 {
                     for( j = 0; j < p_orig[i].i_list; j++ )
-                        p_module->p_config[i].ppsz_list_text[j] =
-                            strdup( _(p_orig[i].ppsz_list_text[j]) );
+                        p_module->p_config[i].ppsz_list_text[j] = _(p_orig[i].ppsz_list_text[j]) ?
+                            strdup( _(p_orig[i].ppsz_list_text[j] ) ) : NULL ;
                     p_module->p_config[i].ppsz_list_text[j] = NULL;
                 }
             }