From 728833ed43c562d2dcd57a585e8819d35a34bc71 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Mon, 1 Dec 2014 13:45:23 -0500 Subject: [PATCH] ecore-wayland: Add safety check for window surface creation Summary: We cannot call wl_proxy_get_id if the surface creation failed else that would lead to an abort in the wayland libraries. This commit adds a safety check @fix Signed-off-by: Chris Michael --- src/lib/ecore_wayland/ecore_wl_window.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c index 63c870f673..5fe64102cb 100644 --- a/src/lib/ecore_wayland/ecore_wl_window.c +++ b/src/lib/ecore_wayland/ecore_wl_window.c @@ -261,7 +261,7 @@ ecore_wl_window_buffer_attach(Ecore_Wl_Window *win, struct wl_buffer *buffer, in } } -EAPI struct wl_surface* +EAPI struct wl_surface * ecore_wl_window_surface_create(Ecore_Wl_Window *win) { LOGFN(__FILE__, __LINE__, __FUNCTION__); @@ -269,6 +269,7 @@ ecore_wl_window_surface_create(Ecore_Wl_Window *win) if (!win) return NULL; if (win->surface) return win->surface; win->surface = wl_compositor_create_surface(_ecore_wl_compositor_get()); + if (!win->surface) return NULL; win->surface_id = wl_proxy_get_id((struct wl_proxy *)win->surface); return win->surface; }