Commit 0aeb82b6 authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

macosx: fixed crash in case either psz_module or psz_msg are NULL when received from core

Fixes playback of AVI files... ;)
parent dad0ff2f
...@@ -157,19 +157,20 @@ static void MsgCallback( msg_cb_data_t *data, msg_item_t *item, unsigned int i ) ...@@ -157,19 +157,20 @@ static void MsgCallback( msg_cb_data_t *data, msg_item_t *item, unsigned int i )
{ {
int canc = vlc_savecancel(); int canc = vlc_savecancel();
NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
NSDictionary *o_dict = [NSDictionary dictionaryWithObjects: /* this may happen from time to time, let's bail out as info would be useless anyway */
[NSArray arrayWithObjects: if( !item->psz_module || !item->psz_msg )
[NSString stringWithUTF8String: item->psz_module], return;
[NSString stringWithUTF8String: item->psz_msg],
[NSNumber numberWithInt: item->i_type], nil] NSDictionary *o_dict = [NSDictionary dictionaryWithObjectsAndKeys:
forKeys: [NSString stringWithUTF8String: item->psz_module], @"Module",
[NSArray arrayWithObjects: @"Module", @"Message", @"Type", nil]]; [NSString stringWithUTF8String: item->psz_msg], @"Message",
[NSNumber numberWithInt: item->i_type], @"Type", nil];
[[NSNotificationCenter defaultCenter] postNotificationName: @"VLCCoreMessageReceived" [[NSNotificationCenter defaultCenter] postNotificationName: @"VLCCoreMessageReceived"
object: nil object: nil
userInfo: o_dict]; userInfo: o_dict];
[o_pool release]; [o_pool release];
vlc_restorecancel( canc ); vlc_restorecancel( canc );
} }
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