summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-01-23 09:27:08 +0100
committerDaniel Stone <daniels@collabora.com>2022-01-26 14:42:08 +0000
commitdfab60c6eedcdbd0455ff0f85b4478ae807afee8 (patch)
tree792df1ab7456e38422627e16bf76130ca5d4d6df
parent4ac64883d8c8116d6ed7e9e9dbf8c9881f886295 (diff)
downloadweston-dfab60c6eedcdbd0455ff0f85b4478ae807afee8.tar.gz
clients/simple-dmabuf-feedback: fix bound global versions
It's invalid for a client to pass the compositor's supported version directly to wl_registry_bind. For instance, under wlroots the client will bind to wl_output version 4 and crash because it doesn't handle the new "name" event. Signed-off-by: Simon Ser <contact@emersion.fr>
-rw-r--r--clients/simple-dmabuf-feedback.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/clients/simple-dmabuf-feedback.c b/clients/simple-dmabuf-feedback.c
index 2fc940c3..dd2e64a5 100644
--- a/clients/simple-dmabuf-feedback.c
+++ b/clients/simple-dmabuf-feedback.c
@@ -1268,7 +1268,7 @@ registry_handle_global(void *data, struct wl_registry *registry,
} else if (strcmp(interface, "wl_output") == 0) {
d->output.wl_output = wl_registry_bind(registry, id,
&wl_output_interface,
- version);
+ MIN(version, 3));
wl_output_add_listener(d->output.wl_output,
&output_listener, &d->output);
} else if (strcmp(interface, "zwp_linux_dmabuf_v1") == 0) {
@@ -1276,7 +1276,7 @@ registry_handle_global(void *data, struct wl_registry *registry,
return;
d->dmabuf = wl_registry_bind(registry, id,
&zwp_linux_dmabuf_v1_interface,
- version);
+ MIN(version, 4));
}
}