[vlc-commits] macosx/open: added missing sanity checks
Felix Paul Kühne
git at videolan.org
Wed Aug 22 16:17:10 CEST 2012
vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Wed Aug 22 16:16:27 2012 +0200| [e139c96cdabca52827db8843d9aaa41eb50460a1] | committer: Felix Paul Kühne
macosx/open: added missing sanity checks
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e139c96cdabca52827db8843d9aaa41eb50460a1
---
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 6f7078e..0088116 100644
--- a/modules/gui/macosx/open.m
+++ b/modules/gui/macosx/open.m
@@ -860,10 +860,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) );
@@ -893,10 +896,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) );
@@ -904,6 +910,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