Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 672136f3 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

fix [1985856] Seg fault when using the soft keyboard in the Messaging app

parent 1c8ffbc7
Loading
Loading
Loading
Loading
+10 −15
Original line number Original line Diff line number Diff line
@@ -177,12 +177,8 @@ status_t LayerBitmap::setSize(uint32_t w, uint32_t h)
sp<Buffer> LayerBitmap::allocate()
sp<Buffer> LayerBitmap::allocate()
{
{
    Mutex::Autolock _l(mLock);
    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;
    surface_info_t* info = mInfo;
        buffer = new Buffer(w, h, mFormat, mFlags);
    sp<Buffer> buffer = new Buffer(mWidth, mHeight, mFormat, mFlags);
    status_t err = buffer->initCheck();
    status_t err = buffer->initCheck();
    if (LIKELY(err == NO_ERROR)) {
    if (LIKELY(err == NO_ERROR)) {
        info->flags  = surface_info_t::eBufferDirty;
        info->flags  = surface_info_t::eBufferDirty;
@@ -192,7 +188,6 @@ sp<Buffer> LayerBitmap::allocate()
        info->status = NO_MEMORY;
        info->status = NO_MEMORY;
    }
    }
    mBuffer = buffer;
    mBuffer = buffer;
    }
    return buffer;
    return buffer;
}
}