From: Kristian Høgsberg Date: Thu, 29 Jul 2010 03:54:16 +0000 (-0400) Subject: egl: Fix deref before NULL-check X-Git-Tag: 062012170305~11134 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c343af09873f35cbc7b265d5606a228fe304bb9;p=profile%2Fivi%2Fmesa.git egl: Fix deref before NULL-check --- diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c index 74a5a63..9fc5296 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;