mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-18 07:41:45 +00:00
hidapi/mac: fixed crash on macOS when AirPods are connected
Signed-off-by: Sam Lantinga <slouken@libsdl.org>
This commit is contained in:
@@ -372,11 +372,14 @@ static int get_string_property(IOHIDDeviceRef device, CFStringRef prop, wchar_t
|
||||
if (!len)
|
||||
return 0;
|
||||
|
||||
if (CFGetTypeID(prop) != CFStringGetTypeID())
|
||||
return 0;
|
||||
|
||||
str = (CFStringRef) IOHIDDeviceGetProperty(device, prop);
|
||||
|
||||
buf[0] = 0;
|
||||
|
||||
if (str) {
|
||||
if (str && CFGetTypeID(str) == CFStringGetTypeID()) {
|
||||
CFIndex str_len = CFStringGetLength(str);
|
||||
CFRange range;
|
||||
CFIndex used_buf_len;
|
||||
|
Reference in New Issue
Block a user