mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/gamepad: bug fix: possible crash at iterating gamepads
Closes #2603
This commit is contained in:
parent
73bb114b2a
commit
796fe13cc5
@ -429,7 +429,8 @@ func supportsXInput(guid windows.GUID) (bool, error) {
|
||||
}
|
||||
size := uint32(unsafe.Sizeof(rdi))
|
||||
if _, err := _GetRawInputDeviceInfoW(ridl[i].hDevice, _RIDI_DEVICEINFO, unsafe.Pointer(&rdi), &size); err != nil {
|
||||
return false, err
|
||||
// GetRawInputDeviceInfoW can return an error (#2603).
|
||||
continue
|
||||
}
|
||||
|
||||
if uint32(rdi.hid.dwVendorId)|(uint32(rdi.hid.dwProductId)<<16) != guid.Data1 {
|
||||
|
Loading…
Reference in New Issue
Block a user