Fix out of bound read of 'has_hat' array
(cherry picked from commit 94b3f78c44
)
This commit is contained in:
parent
951657c99b
commit
f348370e1b
1 changed files with 1 additions and 1 deletions
|
@ -1041,7 +1041,7 @@ static void ConfigJoystick(SDL_Joystick *joystick, int fd)
|
|||
}
|
||||
for (i = 0; i < ABS_MAX; ++i) {
|
||||
/* Skip digital hats */
|
||||
if (joystick->hwdata->has_hat[(i - ABS_HAT0X) / 2]) {
|
||||
if (i >= ABS_HAT0X && i <= ABS_HAT3Y && joystick->hwdata->has_hat[(i - ABS_HAT0X) / 2]) {
|
||||
continue;
|
||||
}
|
||||
if (test_bit(i, absbit)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue