summaryrefslogtreecommitdiff
path: root/libs/gui/BufferQueueConsumer.cpp
diff options
context:
space:
mode:
author Dan Stoza <stoza@google.com> 2015-06-09 18:23:48 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-06-09 18:23:48 +0000
commitb169b49aecdbf3424f334ac2b22c36a2988a8338 (patch)
tree6ca05f9c5e88b4fa777e971fb7c97916a414cce9 /libs/gui/BufferQueueConsumer.cpp
parentc19fdee38a4715b0d642fc8673687715766307cc (diff)
parent993772a60ac43e458f16b08c27e1f97dcfcfe3e1 (diff)
Merge "libgui: Add generation numbers to BufferQueue"
Diffstat (limited to 'libs/gui/BufferQueueConsumer.cpp')
-rw-r--r--libs/gui/BufferQueueConsumer.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/gui/BufferQueueConsumer.cpp b/libs/gui/BufferQueueConsumer.cpp
index 4174676c76..ae796b14db 100644
--- a/libs/gui/BufferQueueConsumer.cpp
+++ b/libs/gui/BufferQueueConsumer.cpp
@@ -248,6 +248,13 @@ status_t BufferQueueConsumer::attachBuffer(int* outSlot,
return INVALID_OPERATION;
}
+ if (buffer->getGenerationNumber() != mCore->mGenerationNumber) {
+ BQ_LOGE("attachBuffer: generation number mismatch [buffer %u] "
+ "[queue %u]", buffer->getGenerationNumber(),
+ mCore->mGenerationNumber);
+ return BAD_VALUE;
+ }
+
// Find a free slot to put the buffer into
int found = BufferQueueCore::INVALID_BUFFER_SLOT;
if (!mCore->mFreeSlots.empty()) {