From 034384f5aae42a5e5bd90f94a68572e179cba07f Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Sun, 31 May 2020 21:23:42 +0000 Subject: [PATCH] export-dmabuf: Keep frame->output = NULL until frame is ready This fixes a crash that happens when a client requests a frame on a backend that does not implement export_dmabuf. An assertion fails with the message: sway: types/wlr_output.c:777: wlr_output_lock_attach_render: Assertion `output->attach_render_locks > 0' failed. --- types/wlr_export_dmabuf_v1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/wlr_export_dmabuf_v1.c b/types/wlr_export_dmabuf_v1.c index 3f17cc8b..c2ec34c8 100644 --- a/types/wlr_export_dmabuf_v1.c +++ b/types/wlr_export_dmabuf_v1.c @@ -98,7 +98,6 @@ static void manager_handle_capture_output(struct wl_client *client, return; } frame->manager = manager; - frame->output = output; wl_list_init(&frame->output_precommit.link); uint32_t version = wl_resource_get_version(manager_resource); @@ -129,6 +128,8 @@ static void manager_handle_capture_output(struct wl_client *client, return; } + frame->output = output; + wlr_output_lock_attach_render(frame->output, true); if (overlay_cursor) { wlr_output_lock_software_cursors(frame->output, true);