mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-08 08:10:14 +01:00
tablet: check the button range before we use it
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Stephen Chandler Paul <thatslyude@gmail.com>
This commit is contained in:
parent
413d6ccfc7
commit
f86c89c5c8
1 changed files with 2 additions and 2 deletions
|
|
@ -167,6 +167,8 @@ tablet_update_button(struct tablet_dispatch *tablet,
|
|||
return;
|
||||
}
|
||||
|
||||
assert(button < 32);
|
||||
|
||||
if (enable) {
|
||||
(*flags) |= 1 << button;
|
||||
tablet_set_status(tablet, TABLET_BUTTONS_PRESSED);
|
||||
|
|
@ -174,8 +176,6 @@ tablet_update_button(struct tablet_dispatch *tablet,
|
|||
(*flags) &= ~(1 << button);
|
||||
tablet_set_status(tablet, TABLET_BUTTONS_RELEASED);
|
||||
}
|
||||
|
||||
assert(button < 32);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue