SDL: Fix potential joystick crash in games with rumble

This commit is contained in:
Jeffrey Pfau 2016-02-20 22:21:37 -08:00
parent 9c73cf536a
commit d7f530ddcf
2 changed files with 2 additions and 1 deletions

View File

@ -7,6 +7,7 @@ Bugfixes:
- 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

View File

@ -593,7 +593,7 @@ void GBASDLHandleEvent(struct GBAThread* context, struct GBASDLPlayer* sdlContex
#if SDL_VERSION_ATLEAST(2, 0, 0)
static void _GBASDLSetRumble(struct GBARumble* rumble, int enable) {
struct GBASDLRumble* sdlRumble = (struct GBASDLRumble*) 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;