summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglapi.c
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2016-12-13 14:23:55 -0800
committerChad Versace <[email protected]>2016-12-14 12:03:15 -0800
commit5e97b8f5ce975dfb66cc46e6b4cc1e89eb8c1dc0 (patch)
tree915e3f0fa039d394dbb7862449974ad08600aeeb /src/egl/main/eglapi.c
parentb18cd8ce2c07c2d1a666fbff1f0d92d17dd5b22c (diff)
egl: Fix crashes in eglCreate*Surface()
Don't dereference a null EGLDisplay. Fixes tests dEQP-EGL.functional.negative_api.create_pbuffer_surface dEQP-EGL.functional.negative_api.create_pixmap_surface Reviewed-by: Mark Janes <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=99038 Cc: "13.0" <[email protected]>
Diffstat (limited to 'src/egl/main/eglapi.c')
-rw-r--r--src/egl/main/eglapi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index 33d562042fd..a349992c463 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -856,7 +856,7 @@ _eglCreateWindowSurfaceCommon(_EGLDisplay *disp, EGLConfig config,
RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);
#ifdef HAVE_SURFACELESS_PLATFORM
- if (disp->Platform == _EGL_PLATFORM_SURFACELESS) {
+ if (disp && disp->Platform == _EGL_PLATFORM_SURFACELESS) {
/* From the EGL_MESA_platform_surfaceless spec (v1):
*
* eglCreatePlatformWindowSurface fails when called with a <display>
@@ -977,7 +977,7 @@ _eglCreatePixmapSurfaceCommon(_EGLDisplay *disp, EGLConfig config,
EGLSurface ret;
#if HAVE_SURFACELESS_PLATFORM
- if (disp->Platform == _EGL_PLATFORM_SURFACELESS) {
+ if (disp && disp->Platform == _EGL_PLATFORM_SURFACELESS) {
/* From the EGL_MESA_platform_surfaceless spec (v1):
*
* [Like eglCreatePlatformWindowSurface,] eglCreatePlatformPixmapSurface