]> git.sesse.net Git - vlc/commitdiff
OSX: fix a crash when the option-list finished by 0, like the new x264_nal_hrd
authorJuho Vähä-Herttua <juhovh@iki.fi>
Sun, 30 May 2010 07:47:53 +0000 (10:47 +0300)
committerIlkka Ollakka <ileoo@videolan.org>
Mon, 31 May 2010 13:56:10 +0000 (16:56 +0300)
(cherry picked from commit 64188f7809f44b9b74f94e07bbd0381b398a6afa)

Signed-off-by: Ilkka Ollakka <ileoo@iki.fi>
(cherry picked from commit 5fd7ef49bdd60d2d9b0c007426627313dec48366)

Signed-off-by: Ilkka Ollakka <ileoo@videolan.org>
modules/gui/macosx/prefs_widgets.m

index efe6a5417edea1248a0584082ec9e6756b6da0cf..ec22b65e606cb4023db98dc9ab599ed354504143 100644 (file)
@@ -1074,7 +1074,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain];       \
             -2, 0, o_textfieldTooltip )
         [o_combo setAutoresizingMask:NSViewWidthSizable ];
         for( i_index = 0; i_index < p_item->i_list; i_index++ )
-            if( p_item->value.psz &&
+            if( p_item->value.psz && p_item->ppsz_list[i_index] &&
                 !strcmp( p_item->value.psz, p_item->ppsz_list[i_index] ) )
                 [o_combo selectItemAtIndex: i_index];
         [self addSubview: o_combo];
@@ -1118,7 +1118,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain];       \
     char *psz_value = config_GetPsz( VLCIntf, p_item->psz_name );
 
     for( i_index = 0; i_index < p_item->i_list; i_index++ )
-        if( psz_value &&
+        if( psz_value && p_item->ppsz_list[i_index] &&
             !strcmp( psz_value, p_item->ppsz_list[i_index] ) )
             [o_combo selectItemAtIndex: i_index];