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

Commit feec3b1a authored by Chia-I Wu's avatar Chia-I Wu
Browse files

libgui: fix BQ buffer allocation error checking

The error path was broken since we moved away from
IGraphicBufferAlloc.

Bug: 37956614
Test: simulate buffer allocation failures
Change-Id: I1e1ec840fafd3075b84126c6dbf6194568175a42
parent d8ac4fd1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -511,7 +511,7 @@ status_t BufferQueueProducer::dequeueBuffer(int *outSlot,
        { // Autolock scope
            Mutex::Autolock lock(mCore->mMutex);

            if (graphicBuffer != NULL && !mCore->mIsAbandoned) {
            if (error == NO_ERROR && !mCore->mIsAbandoned) {
                graphicBuffer->setGenerationNumber(mCore->mGenerationNumber);
                mSlots[*outSlot].mGraphicBuffer = graphicBuffer;
            }
@@ -519,7 +519,7 @@ status_t BufferQueueProducer::dequeueBuffer(int *outSlot,
            mCore->mIsAllocating = false;
            mCore->mIsAllocatingCondition.broadcast();

            if (graphicBuffer == NULL) {
            if (error != NO_ERROR) {
                mCore->mFreeSlots.insert(*outSlot);
                mCore->clearBufferSlotLocked(*outSlot);
                BQ_LOGE("dequeueBuffer: createGraphicBuffer failed");