summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2014-12-01 13:15:15 -0500
committerChris Michael <cp.michael@samsung.com>2014-12-01 13:15:15 -0500
commit4f6895526821b11843c6c7b15626b033c684f3fc (patch)
tree9ebca0a0096d1fe0f9645c9d3f5e824c753b42b1
parent000dbd0b968df845e886bab7de96800748ff5c72 (diff)
ecore-wayland: Check return of input_region create and get our safely
Summary: If wl_region_create fails, then we cannot call wl_region functions on a NULL region. That causes the wayland libraries to abort, so let's add a safety check so that we don't crash. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/lib/ecore_wayland/ecore_wl_window.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c
index e5935b7..5dbd09b 100644
--- a/src/lib/ecore_wayland/ecore_wl_window.c
+++ b/src/lib/ecore_wayland/ecore_wl_window.c
@@ -813,6 +813,12 @@ ecore_wl_window_input_region_set(Ecore_Wl_Window *win, int x, int y, int w, int
813 813
814 region = 814 region =
815 wl_compositor_create_region(_ecore_wl_compositor_get()); 815 wl_compositor_create_region(_ecore_wl_compositor_get());
816 if (!region)
817 {
818 wl_surface_set_input_region(win->surface, NULL);
819 return;
820 }
821
816 wl_region_add(region, x, y, w, h); 822 wl_region_add(region, x, y, w, h);
817 wl_surface_set_input_region(win->surface, region); 823 wl_surface_set_input_region(win->surface, region);
818 wl_region_destroy(region); 824 wl_region_destroy(region);