Commit 74fe3199 by Shannon Woods

Fix handling of null displays in eglMakeCurrent

TRAC #23577 Author: Shannon Woods Signed-off-by: Jamie Madill Signed-off-by: Geoff Lang
parent e2be248f
#define MAJOR_VERSION 1 #define MAJOR_VERSION 1
#define MINOR_VERSION 0 #define MINOR_VERSION 0
#define BUILD_VERSION 0 #define BUILD_VERSION 0
#define BUILD_REVISION 2253 #define BUILD_REVISION 2254
#define STRINGIFY(x) #x #define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x) #define MACRO_STRINGIFY(x) STRINGIFY(x)
......
...@@ -877,17 +877,21 @@ EGLBoolean __stdcall eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface ...@@ -877,17 +877,21 @@ EGLBoolean __stdcall eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface
{ {
egl::Display *display = static_cast<egl::Display*>(dpy); egl::Display *display = static_cast<egl::Display*>(dpy);
gl::Context *context = static_cast<gl::Context*>(ctx); gl::Context *context = static_cast<gl::Context*>(ctx);
IDirect3DDevice9 *device = display->getDevice();
if (!device || display->testDeviceLost()) if (display != EGL_NO_DISPLAY)
{ {
display->notifyDeviceLost(); IDirect3DDevice9 *device = display->getDevice();
return EGL_FALSE;
}
if (display->isDeviceLost()) if (!device || display->testDeviceLost())
{ {
return error(EGL_CONTEXT_LOST, EGL_FALSE); display->notifyDeviceLost();
return EGL_FALSE;
}
if (display->isDeviceLost())
{
return error(EGL_CONTEXT_LOST, EGL_FALSE);
}
} }
if (ctx != EGL_NO_CONTEXT && !validateContext(display, context)) if (ctx != EGL_NO_CONTEXT && !validateContext(display, context))
......
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