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

Commit cc09fccf authored by Chia-I Wu's avatar Chia-I Wu Committed by android-build-merger
Browse files

libgui: fix BQ buffer allocation error checking

am: feec3b1a

Change-Id: Ie63b629a8eb0f4c08eadbcf3a40ceaf8346a71ba
parents 3d696484 feec3b1a
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -511,7 +511,7 @@ status_t BufferQueueProducer::dequeueBuffer(int *outSlot,
        { // Autolock scope
        { // Autolock scope
            Mutex::Autolock lock(mCore->mMutex);
            Mutex::Autolock lock(mCore->mMutex);


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


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