Browse Source

Added a defensive check against XINPUTGETCAPABILITIES being NULL

This should never happen, but it does, possibly due to a data segment overwrite elsewhere.
Sam Lantinga 1 năm trước cách đây
mục cha
commit
20d0a1a3d1
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/joystick/windows/SDL_xinputjoystick.c

+ 1 - 1
src/joystick/windows/SDL_xinputjoystick.c

@@ -218,7 +218,7 @@ void SDL_XINPUT_JoystickDetect(JoyStick_DeviceData **pContext)
 {
     int iuserid;
 
-    if (!s_bXInputEnabled) {
+    if (!s_bXInputEnabled || !XINPUTGETCAPABILITIES) {
         return;
     }