[vlc-commits] macosx: fixed corner-case crash

Felix Paul Kühne git at videolan.org
Sun May 1 14:34:28 CEST 2011


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sun May  1 14:34:21 2011 +0200| [98a2c4f8d8eb1a06dd5571bada5768c689466c4f] | committer: Felix Paul Kühne

macosx: fixed corner-case crash

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=98a2c4f8d8eb1a06dd5571bada5768c689466c4f
---

 modules/gui/macosx/embeddedwindow.m |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/modules/gui/macosx/embeddedwindow.m b/modules/gui/macosx/embeddedwindow.m
index 1172abd..4c915c4 100644
--- a/modules/gui/macosx/embeddedwindow.m
+++ b/modules/gui/macosx/embeddedwindow.m
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * embeddedwindow.m: MacOS X interface module
  *****************************************************************************
- * Copyright (C) 2005-2008 the VideoLAN team
+ * Copyright (C) 2005-2011 the VideoLAN team
  * $Id$
  *
  * Authors: Benjamin Pracht <bigben at videolan dot org>
@@ -425,22 +425,24 @@
     vout_thread_t *p_vout = getVout();
     BOOL blackout_other_displays = config_GetInt( VLCIntf, "macosx-black" );
 
-    screen = [NSScreen screenWithDisplayID:(CGDirectDisplayID)var_GetInteger( p_vout, "video-device" )];
+    if( p_vout )
+        screen = [NSScreen screenWithDisplayID:(CGDirectDisplayID)var_GetInteger( p_vout, "video-device" )];
 
     [self lockFullscreenAnimation];
 
     if (!screen)
     {
-        msg_Dbg( p_vout, "chosen screen isn't present, using current screen for fullscreen mode" );
+        msg_Dbg( VLCIntf, "chosen screen isn't present, using current screen for fullscreen mode" );
         screen = [self screen];
     }
     if (!screen)
     {
-        msg_Dbg( p_vout, "Using deepest screen" );
+        msg_Dbg( VLCIntf, "Using deepest screen" );
         screen = [NSScreen deepestScreen];
     }
 
-    vlc_object_release( p_vout );
+    if( p_vout )
+        vlc_object_release( p_vout );
 
     screen_rect = [screen frame];
 



More information about the vlc-commits mailing list