mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-03-06 17:30:32 +01:00
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:
parent
bb05e0d1b5
commit
d9e2360d62
1 changed files with 3 additions and 0 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue