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

Commit d3144bee authored by Mathias Agopian's avatar Mathias Agopian
Browse files

fix [2170283] SurfaceFlinger crashes on OOM.

when running out of memory, a null handle is returned but the error code may not be set.
In that case we need to return NO_MEMORY instead of NO_ERROR, so that the calling code
won't try to dereference the null pointer.
parent 28541629
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -746,6 +746,8 @@ status_t Surface::getBufferLocked(int index, int usage)
                currentBuffer->setIndex(index);
                mNeedFullUpdate = true;
            }
        } else {
            err = err<0 ? err : NO_MEMORY;
        }
    }
    return err;