[vlc-commits] vout_macosx: add additional sanity checks to prevent rare crashes

Felix Paul Kühne git at videolan.org
Tue Oct 2 13:52:43 CEST 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Oct  1 23:26:48 2012 +0200| [d05cf3d13ca7493bd45d4e495b91ec9b82c384e2] | committer: Felix Paul Kühne

vout_macosx: add additional sanity checks to prevent rare crashes
(cherry picked from commit 48fcb08c1afd28d0aec079e964805254364d8dd8)

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

 modules/video_output/macosx.m |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index 331a8bc..7bd43fe 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -427,6 +427,9 @@ static int Control (vout_display_t *vd, int query, va_list ap)
 static int OpenglLock (vlc_gl_t *gl)
 {
     vout_display_sys_t *sys = (vout_display_sys_t *)gl->sys;
+    if (!sys->glView || ![sys->glView respondsToSelector:@selector(openGLContext)])
+        return 1;
+
     NSOpenGLContext *context = [sys->glView openGLContext];
     CGLError err = CGLLockContext ([context CGLContextObj]);
     if (kCGLNoError == err)



More information about the vlc-commits mailing list