mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
internal/gamepad: bug fix: possible crash at iterating gamepads
Closes #2603
This commit is contained in:
parent
c77673d96d
commit
22dfdfc418
@ -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