From cd30f4f849bb215509bd2645726048271b5db01e Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Mon, 17 May 2010 17:27:26 -0700 Subject: fix some bugs in SharedBufferStack::resize added buffers should now be labeled properly. Change-Id: I28aa753fbe89ab89134e7753575319478934c7fa --- libs/surfaceflinger_client/SharedBufferStack.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libs/surfaceflinger_client') diff --git a/libs/surfaceflinger_client/SharedBufferStack.cpp b/libs/surfaceflinger_client/SharedBufferStack.cpp index 4a98026..5705748 100644 --- a/libs/surfaceflinger_client/SharedBufferStack.cpp +++ b/libs/surfaceflinger_client/SharedBufferStack.cpp @@ -560,6 +560,7 @@ status_t SharedBufferServer::resize(int newNumBuffers) int base = numBuffers; int32_t avail = stack.available; int tail = head - avail + 1; + if (tail >= 0) { int8_t* const index = const_cast(stack.index); const int nb = numBuffers - head; @@ -573,8 +574,9 @@ status_t SharedBufferServer::resize(int newNumBuffers) // fill the new free space with unused buffers BufferList::const_iterator curr(mBufferList.free_begin()); for (int i=0 ; i