From cf775c9cbf86676aa321eb9665fe38aeba35afc9 Mon Sep 17 00:00:00 2001 From: Elvis Lee Date: Wed, 11 Jul 2012 11:13:51 +0900 Subject: egl_dri2: NULL check for EGLNativeWindowType Some application calls eglCreateWindowSurface with EGLNativeWindowType parameter having zero value. It causes SEGV and disturbs error handling like EGL_NO_SURFACE. Signed-off-by: Elvis Lee Signed-off-by: Brian Paul --- src/egl/drivers/dri2/platform_drm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/egl') diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c index 54067ff7814..9aafb525b93 100644 --- a/src/egl/drivers/dri2/platform_drm.c +++ b/src/egl/drivers/dri2/platform_drm.c @@ -108,6 +108,8 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type, switch (type) { case EGL_WINDOW_BIT: + if (!window) + return NULL; surf = gbm_dri_surface((struct gbm_surface *) window); dri2_surf->gbm_surf = surf; dri2_surf->base.Width = surf->base.width; -- cgit v1.2.3