Fix a bug in SurfaceTexture::setBufferCount.
We need to reset mCurrentTexture and mLastQueued in setBufferCount
because it frees all of the buffers associated with the buffer slots.
Change-Id: Ie2f834ec1c07ce7a4ab9b2b5fc5fe8c294010c60
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp
index 10f309a..11a48d9 100644
--- a/libs/gui/SurfaceTexture.cpp
+++ b/libs/gui/SurfaceTexture.cpp
@@ -55,6 +55,8 @@
Mutex::Autolock lock(mMutex);
freeAllBuffers();
mBufferCount = bufferCount;
+ mCurrentTexture = INVALID_BUFFER_SLOT;
+ mLastQueued = INVALID_BUFFER_SLOT;
return OK;
}