SDL: Fix potential joystick crash in games with rumble
Jeffrey Pfau jeffrey@endrift.com
Sat, 20 Feb 2016 22:21:37 -0800
2 files changed,
2 insertions(+),
1 deletions(-)
M
CHANGES
→
CHANGES
@@ -9,6 +9,7 @@ - GBA BIOS: Fix RegisterRamReset setting DISPCNT to the wrong value
- OpenGL: Correct boolean vector strcmp strings for uniforms - Wii: Fix tilting direction - SDL: Fix joystick initialization on BS + - SDL: Fix potential joystick crash in games with rumble Misc: - GBA: Slightly optimize GBAProcessEvents - Qt: Add preset for DualShock 4
M
src/platform/sdl/sdl-events.c
→
src/platform/sdl/sdl-events.c
@@ -572,7 +572,7 @@
#if SDL_VERSION_ATLEAST(2, 0, 0) static void _mSDLSetRumble(struct mRumble* rumble, int enable) { struct mSDLRumble* sdlRumble = (struct mSDLRumble*) rumble; - if (!sdlRumble->p->joystick->haptic || !SDL_HapticRumbleSupported(sdlRumble->p->joystick->haptic)) { + if (!sdlRumble->p->joystick || !sdlRumble->p->joystick->haptic || !SDL_HapticRumbleSupported(sdlRumble->p->joystick->haptic)) { return; } sdlRumble->level += enable;