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

Commit 371957bf 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

am: cc09fccf

Change-Id: I5203cd613cb764a8d72d98532d43ec7826f79c57
parents 0beacddf cc09fccf
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -513,7 +513,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;
            }
            }
@@ -521,7 +521,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");