fix crash when validating an invalid EGL objects
the code that validated EGL objects dereferenced the object
to access its EGLDisplay -- needed for validation (!).
This was wrong for two reasons, first we dereferenced the object
before validating it (potentially leading to a crash), secondly
we didn't validate that the object existed in the right EGLDisplay.
We now use the EGLDisplay passed by the user API.
Change-Id: I66f9e851d4f8507892a6b1fee3065f124c4e7138
diff --git a/opengl/libs/EGL/egl_object.cpp b/opengl/libs/EGL/egl_object.cpp
index dbf9a01..20cdc7e 100644
--- a/opengl/libs/EGL/egl_object.cpp
+++ b/opengl/libs/EGL/egl_object.cpp
@@ -55,10 +55,10 @@
}
}
-bool egl_object_t::get() {
+bool egl_object_t::get(egl_display_t const* display, egl_object_t* object) {
// used by LocalRef, this does an incRef() atomically with
// checking that the object is valid.
- return display->getObject(this);
+ return display->getObject(object);
}
// ----------------------------------------------------------------------------