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

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

don't try to lock a buffer that wasn't allocated with SW usage bits

Change-Id: Iabbcec1bfa30dc47d45ece699dd178653f1b675b
parent a85cdcc1
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -196,6 +196,7 @@ void Layer::reloadTexture(const Region& dirty)
    } else {
slowpath:
        GGLSurface t;
        if (buffer->usage & GRALLOC_USAGE_SW_READ_MASK) {
            status_t res = buffer->lock(&t, GRALLOC_USAGE_SW_READ_OFTEN);
            LOGE_IF(res, "error %d (%s) locking buffer %p",
                    res, strerror(res), buffer.get());
@@ -203,6 +204,9 @@ slowpath:
                mBufferManager.loadTexture(dirty, t);
                buffer->unlock();
            }
        } else {
            // we can't do anything
        }
    }
}