commit | c8093c11286e3c65fb6de686db17b87b0efb1e56 | [log] [tgz] |
---|---|---|
author | Dave Sparks <davidsparks@android.com> | Fri Nov 06 11:47:13 2009 -0800 |
committer | Dave Sparks <davidsparks@android.com> | Fri Nov 06 11:47:13 2009 -0800 |
tree | 68f24cfe8ea87bf8b1e228c9b4afab420c8986d5 | |
parent | 8b1243e5e4930598e8e78ebd18e7b6cd6fb0445f [diff] |
Hold a lock while we access the preview heap. copyFrameAndPostCopiedFrame was not holding a lock while it accessed the preview heap. If the client process is torn down while the heap is accessed, the memcpy could access memory that was deallocated. This patch creates a local sp reference to the preview heap while holding the lock, then releases the lock. This should prevent the heap from being pulled out from underneath us.