backend-wayland: Abort early when wl_shm isn’t advertised

This prevents a segfault in libwayland-cursor when the parent compositor
doesn’t have any of the needed protocols implemented.

Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
dev
Emmanuel Gil Peyrot 4 years ago
parent 557dea5660
commit 0b48e6b5ca
  1. 5
      libweston/backend-wayland/wayland.c

@ -2760,6 +2760,11 @@ wayland_backend_create(struct weston_compositor *compositor,
wl_registry_add_listener(b->parent.registry, &registry_listener, b); wl_registry_add_listener(b->parent.registry, &registry_listener, b);
wl_display_roundtrip(b->parent.wl_display); wl_display_roundtrip(b->parent.wl_display);
if (b->parent.shm == NULL) {
weston_log("Error: Failed to retrieve wl_shm from parent Wayland compositor\n");
goto err_display;
}
create_cursor(b, new_config); create_cursor(b, new_config);
#ifdef ENABLE_EGL #ifdef ENABLE_EGL

Loading…
Cancel
Save