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
commit9ec430adaea1cb88eaa1e78c7f759cd42ab6cf7a (patch)
tree1174b71aeaf88287d38538f8b7baa74532f6f638 /libs/surfaceflinger/Layer.cpp
parentef8646344a7168643b50a51ebffa2e41e9717608 (diff)
downloadframeworks_native-9ec430adaea1cb88eaa1e78c7f759cd42ab6cf7a.zip
frameworks_native-9ec430adaea1cb88eaa1e78c7f759cd42ab6cf7a.tar.gz
frameworks_native-9ec430adaea1cb88eaa1e78c7f759cd42ab6cf7a.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;