summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglcontext.c
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2010-07-28 23:54:16 -0400
committerKristian Høgsberg <[email protected]>2010-07-28 23:54:16 -0400
commit2c343af09873f35cbc7b265d5606a228fe304bb9 (patch)
tree745a62b525614f7c72c0ceb850c52ff3e88b19e3 /src/egl/main/eglcontext.c
parent9456e22c7a8803bed1146a89e7581badf0ae8064 (diff)
egl: Fix deref before NULL-check
Diffstat (limited to 'src/egl/main/eglcontext.c')
-rw-r--r--src/egl/main/eglcontext.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c
index 74a5a632eba..9fc529613e5 100644
--- a/src/egl/main/eglcontext.c
+++ b/src/egl/main/eglcontext.c
@@ -301,7 +301,7 @@ static EGLBoolean
_eglCheckMakeCurrent(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read)
{
_EGLThreadInfo *t = _eglGetCurrentThread();
- _EGLDisplay *dpy = ctx->Resource.Display;
+ _EGLDisplay *dpy;
EGLint conflict_api;
EGLBoolean surfaceless;
@@ -315,6 +315,7 @@ _eglCheckMakeCurrent(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read)
return EGL_TRUE;
}
+ dpy = ctx->Resource.Display;
switch (_eglGetContextAPIBit(ctx)) {
case EGL_OPENGL_ES_BIT:
surfaceless = dpy->Extensions.KHR_surfaceless_gles1;