summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ivan Lozano <ivanlozano@google.com> 2017-12-20 03:36:00 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2017-12-20 03:36:00 +0000
commit95e19cda6ea34f26312890a6be2a56279907fa83 (patch)
treeaccbf2183825ee307eafbef2673fe2895fc1592a
parent739c8b7cea53635e6dfc5e684760cdfb89cdd97c (diff)
parent13f2c07e9c9989e8f29490b1ab46272fc6b4d56b (diff)
Merge "Fix sanitizer in egl_display_t::get."
-rw-r--r--opengl/libs/EGL/egl_display.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/opengl/libs/EGL/egl_display.cpp b/opengl/libs/EGL/egl_display.cpp
index 4e5833ab12..3c1edd148a 100644
--- a/opengl/libs/EGL/egl_display.cpp
+++ b/opengl/libs/EGL/egl_display.cpp
@@ -79,6 +79,10 @@ egl_display_t::~egl_display_t() {
}
egl_display_t* egl_display_t::get(EGLDisplay dpy) {
+ if (uintptr_t(dpy) == 0) {
+ return nullptr;
+ }
+
uintptr_t index = uintptr_t(dpy)-1U;
if (index >= NUM_DISPLAYS || !sDisplay[index].isValid()) {
return nullptr;