[vlc-commits] iOS: check objC-isness before retaining the UIView

Jean-Baptiste Kempf git at videolan.org
Wed Sep 6 14:49:03 CEST 2017


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Sep  6 00:08:18 2017 +0200| [8447297577f666896600f59ec65a6a16834e068d] | committer: Jean-Baptiste Kempf

iOS: check objC-isness before retaining the UIView

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

 modules/video_output/ios.m | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/video_output/ios.m b/modules/video_output/ios.m
index dd590b97eb..a22d281b4d 100644
--- a/modules/video_output/ios.m
+++ b/modules/video_output/ios.m
@@ -483,14 +483,14 @@ static void OpenglESSwap(vlc_gl_t *gl)
             return;
         }
 
+        if (unlikely(![viewContainer respondsToSelector:@selector(isKindOfClass:)])) {
+            msg_Err(_voutDisplay, "void pointer not an ObjC object");
+            return;
+        }
+
         [viewContainer retain];
 
         @synchronized(viewContainer) {
-            if (unlikely(![viewContainer respondsToSelector:@selector(isKindOfClass:)])) {
-                msg_Err(_voutDisplay, "void pointer not an ObjC object");
-                return;
-            }
-
             if (![viewContainer isKindOfClass:[UIView class]]) {
                 msg_Err(_voutDisplay, "passed ObjC object not of class UIView");
                 return;



More information about the vlc-commits mailing list