diff options
-rw-r--r-- | src/evdev-tablet.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c index ae205501..e684055b 100644 --- a/src/evdev-tablet.c +++ b/src/evdev-tablet.c @@ -875,6 +875,8 @@ tablet_get_tool(struct tablet_dispatch *tablet, const struct input_absinfo *pressure; tool = zalloc(sizeof *tool); + if (!tool) + return NULL; *tool = (struct libinput_tablet_tool) { .type = type, .serial = serial, @@ -1295,6 +1297,9 @@ tablet_flush(struct tablet_dispatch *tablet, tablet->current_tool_id, tablet->current_tool_serial); + if (!tool) + return; /* OOM */ + if (tool->type == LIBINPUT_TABLET_TOOL_TYPE_MOUSE || tool->type == LIBINPUT_TABLET_TOOL_TYPE_LENS) tablet_update_proximity_state(tablet, device, tool); |