summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jesse Hall <jessehall@google.com> 2016-09-28 23:04:08 +0000
committer android-build-merger <android-build-merger@google.com> 2016-09-28 23:04:08 +0000
commit4bf4908aab80f8c64caa2ec102f1a9afab0244ab (patch)
tree075bf6fbf8a7f45b8c70f62516ab3d427c5a8b1e
parent1f54f9b392006ac617712d2d29b790d0432e2195 (diff)
parent3169437feb387b56499208464960d281bd9b87c9 (diff)
EGL: check that display is still valid am: d6e9946cdd
am: 3169437feb Change-Id: If2a509e29d5a8cbc06687469279523e5c07fd197
-rw-r--r--opengl/libs/EGL/egl_display.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/opengl/libs/EGL/egl_display.cpp b/opengl/libs/EGL/egl_display.cpp
index e335a6cc31..1e39aae40d 100644
--- a/opengl/libs/EGL/egl_display.cpp
+++ b/opengl/libs/EGL/egl_display.cpp
@@ -66,7 +66,10 @@ egl_display_t::~egl_display_t() {
egl_display_t* egl_display_t::get(EGLDisplay dpy) {
uintptr_t index = uintptr_t(dpy)-1U;
- return (index >= NUM_DISPLAYS) ? NULL : &sDisplay[index];
+ if (index >= NUM_DISPLAYS || !sDisplay[index].isValid()) {
+ return nullptr;
+ }
+ return &sDisplay[index];
}
void egl_display_t::addObject(egl_object_t* object) {