Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4bf4908a authored by Jesse Hall's avatar Jesse Hall Committed by android-build-merger
Browse files

EGL: check that display is still valid am: d6e9946c

am: 3169437f

Change-Id: If2a509e29d5a8cbc06687469279523e5c07fd197
parents 1f54f9b3 3169437f
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -66,7 +66,10 @@ egl_display_t::~egl_display_t() {


egl_display_t* egl_display_t::get(EGLDisplay dpy) {
egl_display_t* egl_display_t::get(EGLDisplay dpy) {
    uintptr_t index = uintptr_t(dpy)-1U;
    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) {
void egl_display_t::addObject(egl_object_t* object) {