summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Versace <chadversary@chromium.org>2016-12-13 14:23:55 -0800
committerEmil Velikov <emil.l.velikov@gmail.com>2016-12-16 13:00:50 +0000
commit12618c1c90b8b2c59a523515eb2e4e55e7c8d17b (patch)
tree17e0d3828adafc5ebca867091b357ee3bb7ed4d6
parent63bdcc5c88441c4226d3717a5fb51e01b144bc2f (diff)
downloadexternal_mesa3d-12618c1c90b8b2c59a523515eb2e4e55e7c8d17b.zip
external_mesa3d-12618c1c90b8b2c59a523515eb2e4e55e7c8d17b.tar.gz
external_mesa3d-12618c1c90b8b2c59a523515eb2e4e55e7c8d17b.tar.bz2
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 <mark.a.janes@intel.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=99038 Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 5e97b8f5ce975dfb66cc46e6b4cc1e89eb8c1dc0)
-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 697b6fe..471cf7e 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -849,7 +849,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>
@@ -970,7 +970,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