[vlc-commits] macosx/open: added missing sanity checks

Felix Paul Kühne git at videolan.org
Wed Aug 22 16:23:58 CEST 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Wed Aug 22 16:16:27 2012 +0200| [366d2126cc3afb0294932ed25629622bf57b7721] | committer: Felix Paul Kühne

macosx/open: added missing sanity checks
(cherry picked from commit e139c96cdabca52827db8843d9aaa41eb50460a1)

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

 modules/gui/macosx/open.m |   17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/modules/gui/macosx/open.m b/modules/gui/macosx/open.m
index 47da57f..b9073fb 100644
--- a/modules/gui/macosx/open.m
+++ b/modules/gui/macosx/open.m
@@ -701,10 +701,13 @@ static VLCOpen *_o_sharedMainInstance = nil;
                                 NULL,
                                 NULL
                                 );
-        if ( noErr == err ) {
+        if ( noErr == err )
             actualVolume = catalogInfo.volume;
-        }
+        else
+            return @"";
     }
+    else
+        return @"";
 
     GetVolParmsInfoBuffer volumeParms;
     err = FSGetVolumeParms( actualVolume, &volumeParms, sizeof(volumeParms) );
@@ -734,10 +737,13 @@ static VLCOpen *_o_sharedMainInstance = nil;
                                 NULL,
                                 NULL
                                 );
-        if ( noErr == err ) {
+        if ( noErr == err )
             actualVolume = catalogInfo.volume;
-        }
+        else
+            return NULL;
     }
+    else
+        return NULL;
 
     GetVolParmsInfoBuffer volumeParms;
     err = FSGetVolumeParms( actualVolume, &volumeParms, sizeof(volumeParms) );
@@ -745,6 +751,9 @@ static VLCOpen *_o_sharedMainInstance = nil;
     CFMutableDictionaryRef matchingDict;
     io_service_t service;
 
+    if (!volumeParms.vMDeviceID)
+        return NULL;
+
     matchingDict = IOBSDNameMatching(kIOMasterPortDefault, 0, volumeParms.vMDeviceID);
     service = IOServiceGetMatchingService(kIOMasterPortDefault, matchingDict);
 



More information about the vlc-commits mailing list