Commit b479244a authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

Mac OS X gui: Protect against NULL string, and fix filter window crash.

parent 39e14fc7
...@@ -224,6 +224,8 @@ static VLCsFilters *_o_sharedInstance = nil; ...@@ -224,6 +224,8 @@ static VLCsFilters *_o_sharedInstance = nil;
- (void)showAsPanel - (void)showAsPanel
{ {
char * psz_temp;
/* called from intf.m */ /* called from intf.m */
[o_sfilter_win displayIfNeeded]; [o_sfilter_win displayIfNeeded];
[o_sfilter_win makeKeyAndOrderFront:nil]; [o_sfilter_win makeKeyAndOrderFront:nil];
...@@ -245,8 +247,11 @@ static VLCsFilters *_o_sharedInstance = nil; ...@@ -245,8 +247,11 @@ static VLCsFilters *_o_sharedInstance = nil;
} }
} }
[o_marq_color_pop selectItemAtIndex: x]; [o_marq_color_pop selectItemAtIndex: x];
[o_marq_marq_fld setStringValue: [NSString stringWithUTF8String: if( psz_temp = config_GetPsz( p_intf, "time-format" ) )
config_GetPsz( p_intf, "marq-marquee" )]]; [o_marq_marq_fld setStringValue: [NSString stringWithUTF8String: psz_temp]];
else
[o_marq_marq_fld setStringValue: _NS(@"Not Available")];
[o_marq_opaque_sld setIntValue: config_GetInt( p_intf, "marq-opacity")]; [o_marq_opaque_sld setIntValue: config_GetInt( p_intf, "marq-opacity")];
[o_marq_pos_radio selectCellWithTag: config_GetInt( p_intf, "marq-position" )]; [o_marq_pos_radio selectCellWithTag: config_GetInt( p_intf, "marq-position" )];
/* FIXME: the following line doesn't work with "-1", which is the default /* FIXME: the following line doesn't work with "-1", which is the default
...@@ -273,8 +278,11 @@ static VLCsFilters *_o_sharedInstance = nil; ...@@ -273,8 +278,11 @@ static VLCsFilters *_o_sharedInstance = nil;
} }
} }
[o_time_color_pop selectItemAtIndex: x]; [o_time_color_pop selectItemAtIndex: x];
[o_time_stamp_fld setStringValue: [NSString stringWithUTF8String: if( psz_temp = config_GetPsz( p_intf, "time-format" ) )
config_GetPsz( p_intf, "time-format" )]]; [o_time_stamp_fld setStringValue: [NSString stringWithUTF8String: psz_temp]];
else
[o_time_stamp_fld setStringValue: _NS(@"Not Available")];
[o_time_opaque_sld setIntValue: config_GetInt( p_intf, "time-opacity")]; [o_time_opaque_sld setIntValue: config_GetInt( p_intf, "time-opacity")];
/* FIXME: the following line doesn't work with "-1", which is the default /* FIXME: the following line doesn't work with "-1", which is the default
* value */ * value */
...@@ -286,9 +294,8 @@ static VLCsFilters *_o_sharedInstance = nil; ...@@ -286,9 +294,8 @@ static VLCsFilters *_o_sharedInstance = nil;
/* retrieve the logo settings */ /* retrieve the logo settings */
[o_logo_opaque_sld setIntValue: config_GetInt( p_intf, "logo-transparency")]; [o_logo_opaque_sld setIntValue: config_GetInt( p_intf, "logo-transparency")];
/* in case that no path has been saved yet */ /* in case that no path has been saved yet */
if( config_GetPsz( p_intf, "logo-file" ) ) if( psz_temp = config_GetPsz( p_intf, "logo-file" ) )
[o_logo_image_fld setStringValue: [NSString stringWithUTF8String: [o_logo_image_fld setStringValue: [NSString stringWithUTF8String: psz_temp]];
config_GetPsz( p_intf, "logo-file" )]];
else else
[o_logo_image_fld setStringValue: @""]; [o_logo_image_fld setStringValue: @""];
[o_logo_pos_radio selectCellWithTag: config_GetInt( p_intf, "logo-position" )]; [o_logo_pos_radio selectCellWithTag: config_GetInt( p_intf, "logo-position" )];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment