summaryrefslogtreecommitdiff
path: root/libs/gui/BufferQueueProducer.cpp
diff options
context:
space:
mode:
author Chia-I Wu <olv@google.com> 2017-05-25 21:27:21 +0000
committer android-build-merger <android-build-merger@google.com> 2017-05-25 21:27:21 +0000
commitcc09fccf625216eb35b90fdd22c27e4f54b06636 (patch)
treecd4b9d49185f8d7c584e81248d877888e6f4bb2f /libs/gui/BufferQueueProducer.cpp
parent3d69648490add3f818fb4f015db583aa6e217a1f (diff)
parentfeec3b1a49dbf48bc792d39d004b42cf2c72b14c (diff)
libgui: fix BQ buffer allocation error checking
am: feec3b1a49 Change-Id: Ie63b629a8eb0f4c08eadbcf3a40ceaf8346a71ba
Diffstat (limited to 'libs/gui/BufferQueueProducer.cpp')
-rw-r--r--libs/gui/BufferQueueProducer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/gui/BufferQueueProducer.cpp b/libs/gui/BufferQueueProducer.cpp
index 6a5593cc1c..3d57769d1a 100644
--- a/libs/gui/BufferQueueProducer.cpp
+++ b/libs/gui/BufferQueueProducer.cpp
@@ -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");