egl: Check for NULL native_window in eglCreateWindowSurface
authorSinclair Yeh <sinclair.yeh@intel.com>
Tue, 3 Jun 2014 21:00:13 +0000 (14:00 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 4 Jun 2014 00:28:30 +0000 (17:28 -0700)
commit91ff0d4c6510dc38f279c586ced17fba917873e7
tree4fc6c0a2224b0dae1d220c6a4405dfb5662cf5bb
parentd2261918202697febed0de18f66416e273001088
egl: Check for NULL native_window in eglCreateWindowSurface

We have customers using NULL as a way to test the robustness of the API.
Without this check, EGL will segfault trying to dereference
dri2_surf->wl_win->private because wl_win is NULL.

This fix adds a check and sets EGL_BAD_NATIVE_WINDOW

v2: Incorporated feedback from idr - moved the check to a higher level
function.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
src/egl/main/eglapi.c