mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-08 12:40:28 +00:00
Check the result of CFStringGetCStringPtr
before assigning it to an std::string.
This commit is contained in:
parent
926b5bebea
commit
b2c6b34a7b
@ -392,7 +392,10 @@ IDeviceList* CoreAudioOut::GetDeviceList() {
|
||||
|
||||
CFStringRef deviceUid;
|
||||
if (AudioObjectGetPropertyData(deviceId, &uidAddress, 0, NULL, &propsize, &deviceUid) == 0) {
|
||||
deviceIdStr = CFStringGetCStringPtr(deviceUid, kCFStringEncodingUTF8);
|
||||
const char* cstr = CFStringGetCStringPtr(deviceUid, kCFStringEncodingUTF8);
|
||||
if (cstr) {
|
||||
deviceIdStr = cstr;
|
||||
}
|
||||
}
|
||||
|
||||
if (deviceNameStr.size() && deviceIdStr.size()) {
|
||||
|
Loading…
Reference in New Issue
Block a user