mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-02-07 04:17:14 +00:00
Fix out of bound read of 'has_hat' array
(cherry picked from commit94b3f78c44) (cherry picked from commitf348370e1b)
This commit is contained in:
committed by
Sam Lantinga
parent
2319b2635b
commit
739d3ec189
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user