all repos — mgba @ 6acc14d31b5faf681b8d67593fea42932f701bfa

mGBA Game Boy Advance Emulator

SDL: Fix potential joystick crash in games with rumble
Jeffrey Pfau jeffrey@endrift.com
Sat, 20 Feb 2016 22:21:37 -0800
commit

6acc14d31b5faf681b8d67593fea42932f701bfa

parent

dc62c52faad0cd269506fa7e1f27a70fcff3538d

2 files changed, 2 insertions(+), 1 deletions(-)

jump to
M CHANGESCHANGES

@@ -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.csrc/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;