macOS: fix crash when IOHIDDevice property is not a string (#573)

- fixed crash on macOS when AirPods are connected (reported to happen with some AirPods on some macOS version);
This commit is contained in:
Sam Lantinga
2023-06-07 01:53:05 -07:00
committed by GitHub
parent fea2357cc5
commit c6c4dd0243
+1 -1
View File
@@ -376,7 +376,7 @@ static int get_string_property(IOHIDDeviceRef device, CFStringRef prop, wchar_t
buf[0] = 0;
if (str) {
if (str && CFGetTypeID(str) == CFStringGetTypeID()) {
CFIndex str_len = CFStringGetLength(str);
CFRange range;
CFIndex used_buf_len;