all repos — mgba @ d7f530ddcf25b60e54ec26ec2a07ec20cd107291

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

d7f530ddcf25b60e54ec26ec2a07ec20cd107291

parent

9c73cf536ab1cb6bba41d2e52178b1d14d69175f

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

jump to
M CHANGESCHANGES

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

@@ -593,7 +593,7 @@

#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;