From 5e34dbf3fcdf39777979fc8022452144e020c27c Mon Sep 17 00:00:00 2001 From: Peter Tissen Date: Sun, 1 Jun 2014 12:22:38 +0200 Subject: [PATCH] limit Dinput devices to the max supported in input_state and update the native submodule to get the MAX_NUM_PADS constant --- Windows/DinputDevice.cpp | 7 ++++++- native | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) 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