From 78bcbfff35ac71a819a9d8224f3d4ab65f581755 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Tue, 26 Aug 2014 14:06:57 -0400 Subject: [PATCH] trap return value of shm_buffer_get This function Can fail to return an shm_buffer if the buffer_resource is an EGL buffer. Signed-off-by: Chris Michael --- src/bin/e_comp_wl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index a257a0641..81e6a0a03 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -163,7 +163,9 @@ _e_comp_wl_surface_cb_attach(struct wl_client *client, struct wl_resource *resou { struct wl_shm_buffer *b; - b = wl_shm_buffer_get(buffer_resource); + /* trap return of shm_buffer_get as it Can fail if the buffer is not + * an shm buffer (ie: egl buffer) */ + if (!(b = wl_shm_buffer_get(buffer_resource))) return; ec->comp_data->pending.w = wl_shm_buffer_get_width(b); ec->comp_data->pending.h = wl_shm_buffer_get_height(b);