diff options
| author | 2017-12-20 03:48:37 +0000 | |
|---|---|---|
| committer | 2017-12-20 03:48:37 +0000 | |
| commit | 2f5196ac99f4bf0a3e10c6e2807356a6599f54d0 (patch) | |
| tree | f9cafccea4e0cf5956c01087eabd8cf06607996a | |
| parent | 6531a6dc2350082a807424c27b09df0ccdaff073 (diff) | |
| parent | 66ecc5ef7dd0d31b3a7eebcb232d9bf8a73be682 (diff) | |
Merge "Fix sanitizer in egl_display_t::get." am: 95e19cda6e
am: 66ecc5ef7d
Change-Id: Icdd858438f168551260cd0b4b10de1fe5087ec22
| -rw-r--r-- | opengl/libs/EGL/egl_display.cpp | 4 |
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; |