diff options
author | Andri Yngvason <andri@yngvason.is> | 2020-05-31 21:23:42 +0000 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-06-01 12:50:26 +0200 |
commit | 034384f5aae42a5e5bd90f94a68572e179cba07f (patch) | |
tree | f0c5e652b3d259626e242bac0fb4a770ae3437fd | |
parent | 32148808ad7bf7d2c072dc6491453f97e8c3cd35 (diff) |
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.
-rw-r--r-- | types/wlr_export_dmabuf_v1.c | 3 |
1 files changed, 2 insertions, 1 deletions
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); |