diff options
| author | 2009-07-28 19:18:32 -0700 | |
|---|---|---|
| committer | 2009-07-28 19:18:32 -0700 | |
| commit | e1c00aab871066935f68c92d39a82ed61e71d812 (patch) | |
| tree | 82fc12c7791a8b47f5e4b4ef74d68127619e02c1 | |
| parent | 103209189cba985dbad20c807cd0e8fc10e06a52 (diff) | |
| parent | c915d0a33cda6cc16bf1685ccc0389787119a213 (diff) | |
Merge change 8931
* changes:
fix [1985856] Seg fault when using the soft keyboard in the Messaging app
| -rw-r--r-- | libs/surfaceflinger/LayerBitmap.cpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/libs/surfaceflinger/LayerBitmap.cpp b/libs/surfaceflinger/LayerBitmap.cpp index 9fffbbfbb9ff..ff49c87db311 100644 --- a/libs/surfaceflinger/LayerBitmap.cpp +++ b/libs/surfaceflinger/LayerBitmap.cpp @@ -177,22 +177,17 @@ status_t LayerBitmap::setSize(uint32_t w, uint32_t h) sp<Buffer> LayerBitmap::allocate() { Mutex::Autolock _l(mLock); - sp<Buffer> buffer(mBuffer); - const uint32_t w = mWidth; - const uint32_t h = mHeight; - if (buffer!=0 && (w != buffer->getWidth() || h != buffer->getHeight())) { - surface_info_t* info = mInfo; - buffer = new Buffer(w, h, mFormat, mFlags); - status_t err = buffer->initCheck(); - if (LIKELY(err == NO_ERROR)) { - info->flags = surface_info_t::eBufferDirty; - info->status = NO_ERROR; - } else { - memset(info, 0, sizeof(surface_info_t)); - info->status = NO_MEMORY; - } - mBuffer = buffer; + surface_info_t* info = mInfo; + sp<Buffer> buffer = new Buffer(mWidth, mHeight, mFormat, mFlags); + status_t err = buffer->initCheck(); + if (LIKELY(err == NO_ERROR)) { + info->flags = surface_info_t::eBufferDirty; + info->status = NO_ERROR; + } else { + memset(info, 0, sizeof(surface_info_t)); + info->status = NO_MEMORY; } + mBuffer = buffer; return buffer; } |