From d369dc42506ec003f1839bb9e27edada411324b5 Mon Sep 17 00:00:00 2001 From: Jamie Gennis Date: Sun, 9 Jan 2011 13:25:39 -0800 Subject: 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 --- libs/gui/SurfaceTexture.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libs/gui/SurfaceTexture.cpp') diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp index 10f309adc893..11a48d989425 100644 --- a/libs/gui/SurfaceTexture.cpp +++ b/libs/gui/SurfaceTexture.cpp @@ -55,6 +55,8 @@ status_t SurfaceTexture::setBufferCount(int bufferCount) { Mutex::Autolock lock(mMutex); freeAllBuffers(); mBufferCount = bufferCount; + mCurrentTexture = INVALID_BUFFER_SLOT; + mLastQueued = INVALID_BUFFER_SLOT; return OK; } -- cgit v1.2.3-59-g8ed1b