diff --git a/Windows/DinputDevice.cpp b/Windows/DinputDevice.cpp index e2df8dc610..f25559bc6c 100644 --- a/Windows/DinputDevice.cpp +++ b/Windows/DinputDevice.cpp @@ -143,8 +143,13 @@ DinputDevice::DinputDevice(int devnum) { return; } + if (devnum >= MAX_NUM_PADS) + { + return; + } + getDevices(); - if ( (devnum > devices.size()) || FAILED(getPDI()->CreateDevice(devices.at(devnum).guidInstance, &pJoystick, NULL))) + if ( (devnum >= devices.size()) || FAILED(getPDI()->CreateDevice(devices.at(devnum).guidInstance, &pJoystick, NULL))) { return; } diff --git a/native b/native index f4d66f5c50..d3fb0459e6 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit f4d66f5c5057300f2ca83e46657b17de8dd472d2 +Subproject commit d3fb0459e6eb526a986d1e0d3d4f9e18a650621a