mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-20 06:50:04 +01:00
wlr_virtual_pointer: Set axis source on all axis
Currently it is possible to crash a wlroots compositor by setting any axis source other than 0 and sending an axis event in the HORIZONTAL direction from wlr_virtual_pointer since the axis source is only set on the first axis. This then hits the assert in wlr_seat_pointer.c:332. Fix by always setting the source on all axis.
This commit is contained in:
parent
8f7d763ad1
commit
aef84f0e4d
1 changed files with 5 additions and 2 deletions
|
|
@ -134,8 +134,11 @@ static void virtual_pointer_axis_source(struct wl_client *client,
|
||||||
if (pointer == NULL) {
|
if (pointer == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pointer->axis_event[pointer->axis].pointer = &pointer->pointer;
|
int n_axis = sizeof(pointer->axis_event) / sizeof(pointer->axis_event[0]);
|
||||||
pointer->axis_event[pointer->axis].source = source;
|
for (int i = 0; i < n_axis; i++) {
|
||||||
|
pointer->axis_event[i].pointer = &pointer->pointer;
|
||||||
|
pointer->axis_event[i].source = source;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void virtual_pointer_axis_stop(struct wl_client *client,
|
static void virtual_pointer_axis_stop(struct wl_client *client,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue