Commit 2b6ac18d by Alexis Hetu Committed by Alexis Hétu

Added EGL display validity check

If the EGLDisplay input parameter to eglInitialize isn't PRIMARY_DISPLAY or HEADLESS_DISPLAY, egl::Display::get() will return null. Instead of crashing, we should return an EGL_BAD_DISPLAY error. Change-Id: Ie1e39f2807db5a38f8d21fd6e22270c02cbeba3a Reviewed-on: https://swiftshader-review.googlesource.com/9813Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent 2c0546d3
......@@ -133,13 +133,13 @@ EGLBoolean Initialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
TRACE("(EGLDisplay dpy = %p, EGLint *major = %p, EGLint *minor = %p)",
dpy, major, minor);
if(dpy == EGL_NO_DISPLAY)
egl::Display *display = egl::Display::get(dpy);
if(!display)
{
return error(EGL_BAD_DISPLAY, EGL_FALSE);
}
egl::Display *display = egl::Display::get(dpy);
if(!display->initialize())
{
return error(EGL_NOT_INITIALIZED, EGL_FALSE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment