From d9e2360d6253021fe41ceb0d1ece4417a246677f Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 9 Jul 2025 10:48:11 +1000 Subject: [PATCH] tablet: fix segfault on pressure-less tablets Check whether a tablet has a pressure axis before unconditionally dereferencing it. Fixes: e9f3fc080cda ("tablet: revamp the tablet pressure range handling") Closes #1152 Part-of: --- src/evdev-tablet.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c index a04a5b2d..77fae45f 100644 --- a/src/evdev-tablet.c +++ b/src/evdev-tablet.c @@ -2162,6 +2162,9 @@ update_pressure_range(struct tablet_dispatch *tablet, struct evdev_device *device, struct libinput_tablet_tool *tool) { + if (!libevdev_has_event_code(device->evdev, EV_ABS, ABS_PRESSURE)) + return; + double min = tool->pressure.range.min; double max = tool->pressure.range.max;