aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-09-19 11:29:48 +0200
committeremersion <contact@emersion.fr>2018-09-19 11:29:48 +0200
commitac28d701c0c06de5f319ea24eb817913a7bfe75f (patch)
treedfaa9570b244f79a36c21a83fc1edb7eff5b2b5b
parent3693fae0c44d83cab2c701bd44b80d8f6242781e (diff)
buffer: disconnect clients that commit an unknown buffer type
If this happens, something went really wrong and we should do more than just logging an error. See [1]. [1]: https://gitlab.freedesktop.org/wayland/weston/issues/148
-rw-r--r--types/wlr_buffer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/types/wlr_buffer.c b/types/wlr_buffer.c
index 55ed4792..ce733f40 100644
--- a/types/wlr_buffer.c
+++ b/types/wlr_buffer.c
@@ -87,6 +87,10 @@ struct wlr_buffer *wlr_buffer_create(struct wlr_renderer *renderer,
// the buffer yet.
} else {
wlr_log(WLR_ERROR, "Cannot upload texture: unknown buffer type");
+
+ // Instead of just logging the error, also disconnect the client with a
+ // fatal protocol error so that it's clear something went wrong.
+ wl_resource_post_error(resource, 0, "unknown buffer type");
return NULL;
}