Fix an out-of-bounds memory assignment on joystick button press.