From 9227e25660c80524ae9688a77cc7b93f97806d4c Mon Sep 17 00:00:00 2001 From: Vitaliy Margolen Date: Tue, 6 May 2008 10:28:12 -0600 Subject: [PATCH] dinput: Ignore events from extra joystick buttons. --- dlls/dinput/joystick_linux.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index a15139035d..9dead0a9c7 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -698,6 +698,8 @@ static void joy_polldev(JoystickImpl *This) { jse.type,jse.number,jse.value); if (jse.type & JS_EVENT_BUTTON) { + if (jse.number >= This->devcaps.dwButtons) return; + inst_id = DIDFT_MAKEINSTANCE(jse.number) | DIDFT_PSHBUTTON; This->js.rgbButtons[jse.number] = value = jse.value ? 0x80 : 0x00; }