summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/evdev.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 0fcb0bb..2c88343 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -2790,6 +2790,9 @@ static void EvdevInitButtonLabels(EvdevPtr pEvdev, int natoms, Atom *atoms)
int group = (button % 0x100)/16;
int idx = button - ((button/16) * 16);
+ if (group >= ArrayLength(btn_labels))
+ break;
+
if (!libevdev_has_event_code(pEvdev->dev, EV_KEY, button))
continue;