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

Commit 1b3049e5 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Adding negative slot index check in ComposerResources"

parents 300fc770 ef77263b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -170,7 +170,7 @@ class ComposerHandleCache {
    }

    Error lookupCache(uint32_t slot, const native_handle_t** outHandle) {
        if (slot < mHandles.size()) {
        if (slot >= 0 && slot < mHandles.size()) {
            *outHandle = mHandles[slot];
            return Error::NONE;
        } else {
@@ -180,7 +180,7 @@ class ComposerHandleCache {

    Error updateCache(uint32_t slot, const native_handle_t* handle,
                      const native_handle** outReplacedHandle) {
        if (slot < mHandles.size()) {
        if (slot >= 0 && slot < mHandles.size()) {
            auto& cachedHandle = mHandles[slot];
            *outReplacedHandle = cachedHandle;
            cachedHandle = handle;