tablet: fix segfault on pressure-less tablets

Check whether a tablet has a pressure axis before unconditionally
dereferencing it.

Fixes: e9f3fc080c ("tablet: revamp the tablet pressure range handling")

Closes #1152

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1263>
This commit is contained in:
Peter Hutterer 2025-07-09 10:48:11 +10:00 committed by Marge Bot
parent bb05e0d1b5
commit d9e2360d62

View file

@ -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;