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

Commit 3169437f authored by Jesse Hall's avatar Jesse Hall Committed by android-build-merger
Browse files

EGL: check that display is still valid

am: d6e9946c

Change-Id: I6d5f5e6f4790f16c1bd52f96743c7e138973a1b4
parents 0627130b d6e9946c
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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) {