summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger/Layer.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-10-06 19:00:57 -0700
committerMathias Agopian <mathias@google.com>2009-10-06 19:00:57 -0700
commit4961c959aebac31991fd7653853d47dfd79d3472 (patch)
tree5d2837183bf21c756e84fd28a231a8e0674b76c5 /libs/surfaceflinger/Layer.cpp
parent9d6a685ba939f413a8d3e1e97627593aa1cdf6cb (diff)
downloadframeworks_base-4961c959aebac31991fd7653853d47dfd79d3472.zip
frameworks_base-4961c959aebac31991fd7653853d47dfd79d3472.tar.gz
frameworks_base-4961c959aebac31991fd7653853d47dfd79d3472.tar.bz2
fix [2152536] ANR in browser
A window is created and the browser is about to render into it the very first time, at that point it does an IPC to SF to request a new buffer. Meanwhile, the window manager removes that window from the list and the shared memory block it uses is marked as invalid. However, at that point, another window is created and is given the same index (that just go freed), but a different identity and resets the "invalid" bit in the shared block. When we go back to the buffer allocation code, we're stuck because the surface we're allocating for is gone and we don't detect it's invalid because the invalid bit has been reset. It is not sufficient to check for the invalid bit, I should also check that identities match.
Diffstat (limited to 'libs/surfaceflinger/Layer.cpp')
-rw-r--r--libs/surfaceflinger/Layer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/surfaceflinger/Layer.cpp b/libs/surfaceflinger/Layer.cpp
index eb0614f..0258cee 100644
--- a/libs/surfaceflinger/Layer.cpp
+++ b/libs/surfaceflinger/Layer.cpp
@@ -133,7 +133,7 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h,
void Layer::reloadTexture(const Region& dirty)
{
Mutex::Autolock _l(mLock);
- sp<GraphicBuffer> buffer(getFrontBuffer());
+ sp<GraphicBuffer> buffer(getFrontBufferLocked());
if (LIKELY((mFlags & DisplayHardware::DIRECT_TEXTURE) &&
(buffer->usage & GRALLOC_USAGE_HW_TEXTURE))) {
int index = mFrontBufferIndex;
@@ -194,7 +194,7 @@ void Layer::reloadTexture(const Region& dirty)
}
}
} else {
- for (int i=0 ; i<NUM_BUFFERS ; i++)
+ for (size_t i=0 ; i<NUM_BUFFERS ; i++)
mTextures[i].image = EGL_NO_IMAGE_KHR;
GGLSurface t;