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 dc62c52faa
commit 6acc14d31b
2 changed files with 2 additions and 1 deletions

View File

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

@ -572,7 +572,7 @@ void mSDLHandleEvent(struct mCoreThread* context, struct mSDLPlayer* sdlContext,
#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;