diff options
| author | 2017-05-25 21:32:25 +0000 | |
|---|---|---|
| committer | 2017-05-25 21:32:25 +0000 | |
| commit | 371957bfe71efa7d55006d73a9e1d6b80da45081 (patch) | |
| tree | e53c154352f0c40123eef666cd467606aea9cd7b /libs/gui/BufferQueueProducer.cpp | |
| parent | 0beacddfb718788b8663c33bbbe52190070681af (diff) | |
| parent | cc09fccf625216eb35b90fdd22c27e4f54b06636 (diff) | |
libgui: fix BQ buffer allocation error checking am: feec3b1a49
am: cc09fccf62
Change-Id: I5203cd613cb764a8d72d98532d43ec7826f79c57
Diffstat (limited to 'libs/gui/BufferQueueProducer.cpp')
| -rw-r--r-- | libs/gui/BufferQueueProducer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/gui/BufferQueueProducer.cpp b/libs/gui/BufferQueueProducer.cpp index b76e2c68b5..7510069963 100644 --- a/libs/gui/BufferQueueProducer.cpp +++ b/libs/gui/BufferQueueProducer.cpp @@ -513,7 +513,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; } @@ -521,7 +521,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"); |