[vlc-commits] mac plugin: add additional sanity checks before access objc objects

Felix Paul Kühne git at videolan.org
Mon Apr 28 19:35:17 CEST 2014


npapi-vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Apr 28 19:35:08 2014 +0200| [81be7e6adb8cc736f4430d8e402406a8b8742f58] | committer: Felix Paul Kühne

mac plugin: add additional sanity checks before access objc objects

> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=81be7e6adb8cc736f4430d8e402406a8b8742f58
---

 npapi/vlcplugin_mac.mm |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/npapi/vlcplugin_mac.mm b/npapi/vlcplugin_mac.mm
index 2d32f1a..a06d0df 100644
--- a/npapi/vlcplugin_mac.mm
+++ b/npapi/vlcplugin_mac.mm
@@ -338,7 +338,8 @@ bool VlcPluginMac::handle_event(void *event)
             CGPoint point = CGPointMake(cocoaEvent->data.mouse.pluginX,
                                         // Flip the y coordinate
                                         npwindow.height - cocoaEvent->data.mouse.pluginY);
-            [controllerLayer handleMouseDown:[browserRootLayer convertPoint:point toLayer:controllerLayer]];
+            if (controllerLayer)
+                [controllerLayer handleMouseDown:[browserRootLayer convertPoint:point toLayer:controllerLayer]];
 
             return true;
         }
@@ -352,7 +353,8 @@ bool VlcPluginMac::handle_event(void *event)
                                         // Flip the y coordinate
                                         npwindow.height - cocoaEvent->data.mouse.pluginY);
 
-            [controllerLayer handleMouseUp:[browserRootLayer convertPoint:point toLayer:controllerLayer]];
+            if (controllerLayer)
+                [controllerLayer handleMouseUp:[browserRootLayer convertPoint:point toLayer:controllerLayer]];
 
             return true;
         }
@@ -369,7 +371,8 @@ bool VlcPluginMac::handle_event(void *event)
                                         // Flip the y coordinate
                                         npwindow.height - cocoaEvent->data.mouse.pluginY);
 
-            [controllerLayer handleMouseDragged:[browserRootLayer convertPoint:point toLayer:controllerLayer]];
+            if (controllerLayer)
+                [controllerLayer handleMouseDragged:[browserRootLayer convertPoint:point toLayer:controllerLayer]];
 
             return true;
         }



More information about the vlc-commits mailing list