mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-09 04:48:04 +02:00
compositor: Don't try and destroy old pointer surface if it empty
If attach was called on wl_input_device with a nil buffer twice then the second call would cause a segfault.
This commit is contained in:
parent
b07876d23a
commit
0b17b8ec01
1 changed files with 4 additions and 2 deletions
|
|
@ -1609,8 +1609,10 @@ input_device_attach(struct wl_client *client,
|
|||
weston_surface_damage_below(device->sprite);
|
||||
|
||||
if (!buffer_resource) {
|
||||
destroy_surface(&device->sprite->surface.resource);
|
||||
device->sprite = NULL;
|
||||
if (device->sprite) {
|
||||
destroy_surface(&device->sprite->surface.resource);
|
||||
device->sprite = NULL;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue