Commit 366d2126 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx/open: added missing sanity checks

(cherry picked from commit e139c96c)
parent 3acd873e
...@@ -701,10 +701,13 @@ static VLCOpen *_o_sharedMainInstance = nil; ...@@ -701,10 +701,13 @@ static VLCOpen *_o_sharedMainInstance = nil;
NULL, NULL,
NULL NULL
); );
if ( noErr == err ) { if ( noErr == err )
actualVolume = catalogInfo.volume; actualVolume = catalogInfo.volume;
} else
return @"";
} }
else
return @"";
GetVolParmsInfoBuffer volumeParms; GetVolParmsInfoBuffer volumeParms;
err = FSGetVolumeParms( actualVolume, &volumeParms, sizeof(volumeParms) ); err = FSGetVolumeParms( actualVolume, &volumeParms, sizeof(volumeParms) );
...@@ -734,10 +737,13 @@ static VLCOpen *_o_sharedMainInstance = nil; ...@@ -734,10 +737,13 @@ static VLCOpen *_o_sharedMainInstance = nil;
NULL, NULL,
NULL NULL
); );
if ( noErr == err ) { if ( noErr == err )
actualVolume = catalogInfo.volume; actualVolume = catalogInfo.volume;
} else
return NULL;
} }
else
return NULL;
GetVolParmsInfoBuffer volumeParms; GetVolParmsInfoBuffer volumeParms;
err = FSGetVolumeParms( actualVolume, &volumeParms, sizeof(volumeParms) ); err = FSGetVolumeParms( actualVolume, &volumeParms, sizeof(volumeParms) );
...@@ -745,6 +751,9 @@ static VLCOpen *_o_sharedMainInstance = nil; ...@@ -745,6 +751,9 @@ static VLCOpen *_o_sharedMainInstance = nil;
CFMutableDictionaryRef matchingDict; CFMutableDictionaryRef matchingDict;
io_service_t service; io_service_t service;
if (!volumeParms.vMDeviceID)
return NULL;
matchingDict = IOBSDNameMatching(kIOMasterPortDefault, 0, volumeParms.vMDeviceID); matchingDict = IOBSDNameMatching(kIOMasterPortDefault, 0, volumeParms.vMDeviceID);
service = IOServiceGetMatchingService(kIOMasterPortDefault, matchingDict); service = IOServiceGetMatchingService(kIOMasterPortDefault, matchingDict);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment