mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-03-29 07:58:24 -04:00
wlr_ext_image_copy_capture_v1: Fix crash when client creates a cursor session not implemented server side
This guards against a crash where the server implements
wlr_ext_image_capture_source_v1_interface without setting .get_pointer_cursor().
In general, we should install a NULL check here because this is a crash
waiting to happen. Now, instead of crashing, the resource will be created and
the copy capture session will be stopped.
(cherry picked from commit 1fc928d528)
This commit is contained in:
parent
ba32abbddb
commit
47a43e14ae
1 changed files with 5 additions and 3 deletions
|
|
@ -518,14 +518,16 @@ static void cursor_session_handle_get_capture_session(struct wl_client *client,
|
|||
return;
|
||||
}
|
||||
|
||||
cursor_session->capture_session_created = true;
|
||||
|
||||
struct wlr_ext_image_copy_capture_manager_v1 *manager = NULL;
|
||||
struct wlr_ext_image_capture_source_v1 *source = NULL;
|
||||
|
||||
if (cursor_session != NULL) {
|
||||
manager = cursor_session->manager;
|
||||
cursor_session->capture_session_created = true;
|
||||
source = &cursor_session->source->base;
|
||||
}
|
||||
|
||||
session_create(cursor_session_resource, new_id, source, 0, cursor_session->manager);
|
||||
session_create(cursor_session_resource, new_id, source, 0, manager);
|
||||
}
|
||||
|
||||
static const struct ext_image_copy_capture_cursor_session_v1_interface cursor_session_impl = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue