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

Commit ef77263b authored by Valerie Hau's avatar Valerie Hau
Browse files

Adding negative slot index check in ComposerResources

Bug: N/A
Test: build, boot
Change-Id: I8ab18ed8f7c322ee995abc534309b51e796276fe
parent 17b3a4f6
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;