internal/gamepad: bug fix: do not call GetRawInputDeviceList with the count 0

Updates #2696
This commit is contained in:
Hajime Hoshi 2023-07-08 19:17:59 +09:00
parent bc2b373bca
commit 4267e5d22e

View File

@ -414,6 +414,10 @@ func supportsXInput(guid windows.GUID) (bool, error) {
return false, nil
}
if count == 0 {
return false, nil
}
ridl := make([]_RAWINPUTDEVICELIST, count)
if _, err := _GetRawInputDeviceList(&ridl[0], &count); err != nil {
return false, err