From: Jesse Hall Date: Wed, 28 Sep 2016 18:26:57 +0000 (-0700) Subject: EGL: check that display is still valid X-Git-Tag: android-x86-7.1-r1~55^2~4 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=d6e9946cdd;p=android-x86%2Fframeworks-native.git EGL: check that display is still valid Bug: 31522731 Change-Id: I84d82e55aba5b58dfdbcac9e208c36767fbedfd1 --- 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) {