소스 검색

joystick: Fix PS5 player LED hint change callback name

The LED hint was getting registered for SDL_HINT_JOYSTICK_ENHANCED_REPORTS
instead of SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED, which results in a
use-after-free followed by a crash.
Stenzek 1 년 전
부모
커밋
78721d720c
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/joystick/hidapi/SDL_hidapi_ps5.c

+ 1 - 1
src/joystick/hidapi/SDL_hidapi_ps5.c

@@ -952,7 +952,7 @@ static bool HIDAPI_DriverPS5_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystic
 
     SDL_AddHintCallback(SDL_HINT_JOYSTICK_ENHANCED_REPORTS,
                         SDL_PS5EnhancedReportsChanged, ctx);
-    SDL_AddHintCallback(SDL_HINT_JOYSTICK_ENHANCED_REPORTS,
+    SDL_AddHintCallback(SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED,
                         SDL_PS5PlayerLEDHintChanged, ctx);
 
     return true;