summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2015-06-18 20:19:32 +0100
committerEmil Velikov <[email protected]>2015-06-30 17:34:31 +0100
commit0afa6335079093627b47ff08da38bed00972c217 (patch)
tree6b9ecfef1d07f777cf4de0493587dba1772346a8 /src/egl/drivers
parent6098ef824467f685fb34914eb3fef73b3ba18c6f (diff)
egl/wayland: handle NULL native_window in create_surface
Raise EGL_BAD_NATIVE_WINDOW instead of crashing. v2: s/Rise/Raise/ (spotted by Michel) Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/egl/drivers')
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index 160fa8ce8d7..6f42d90ed96 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -149,6 +149,11 @@ dri2_wl_create_surface(_EGLDriver *drv, _EGLDisplay *disp,
else
dri2_surf->format = WL_DRM_FORMAT_ARGB8888;
+ if (!window) {
+ _eglError(EGL_BAD_NATIVE_WINDOW, "dri2_create_surface");
+ goto cleanup_surf;
+ }
+
dri2_surf->wl_win = window;
dri2_surf->wl_win->private = dri2_surf;