fix a possible null dereference when eglMakeCurrent() fails
Bug: 10648797
Change-Id: Iee0be47f2646feb25de4ea199bbb9b707452916e
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index 9d792fb..d3bc14a 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -745,7 +745,8 @@
}
} else {
// this will ALOGE the error
- result = setError(c->cnx->egl.eglGetError(), EGL_FALSE);
+ egl_connection_t* const cnx = &gEGLImpl;
+ result = setError(cnx->egl.eglGetError(), EGL_FALSE);
}
return result;
}