소스 검색

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 년 전
부모
커밋
20d0a1a3d1
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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;
     }