Skip to content

Commit c6c4dd0

Browse files
authored
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);
1 parent fea2357 commit c6c4dd0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mac/hid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ static int get_string_property(IOHIDDeviceRef device, CFStringRef prop, wchar_t
376376

377377
buf[0] = 0;
378378

379-
if (str) {
379+
if (str && CFGetTypeID(str) == CFStringGetTypeID()) {
380380
CFIndex str_len = CFStringGetLength(str);
381381
CFRange range;
382382
CFIndex used_buf_len;

0 commit comments

Comments
 (0)