Kaydet (Commit) a0b549c0 authored tarafından Caolán McNamara's avatar Caolán McNamara

fix 4 separate new bugs in BitmapMosaicFilter

coverity#1435274 Dereference after null check
coverity#1435276 Resource leak
coverity#1435278 Resource leak
and on success it returned its input, throwing
away the result of its calculation

commit 63a71678
Author: Chris Sherlock <chris.sherlock79@gmail.com>
Date:   Fri Apr 20 20:39:48 2018 +1000

    vcl: ImplMosaic() -> BitmapMosaicFilter

    Change-Id: Ia0910ae9166c4eb6b870ab25db761bc1703fec68
    Reviewed-on: https://gerrit.libreoffice.org/53203Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>

Change-Id: I4eb74ef279b2ead268d07ac572ab76cd911dacb6
Reviewed-on: https://gerrit.libreoffice.org/53807Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst aaeb63a9
......@@ -166,20 +166,27 @@ BitmapEx BitmapMosaicFilter::execute(BitmapEx const& rBitmapEx)
Bitmap::ReleaseAccess(pReadAcc);
if (bRet)
if (pNewBmp)
{
const MapMode aMap(aBitmap.GetPrefMapMode());
const Size aPrefSize(aBitmap.GetPrefSize());
Bitmap::ReleaseAccess(pWriteAcc);
aBitmap = *pNewBmp;
if (bRet)
{
const MapMode aMap(aBitmap.GetPrefMapMode());
const Size aPrefSize(aBitmap.GetPrefSize());
aBitmap = *pNewBmp;
aBitmap.SetPrefMapMode(aMap);
aBitmap.SetPrefSize(aPrefSize);
}
aBitmap.SetPrefMapMode(aMap);
aBitmap.SetPrefSize(aPrefSize);
delete pNewBmp;
}
}
if (bRet)
return rBitmapEx;
return BitmapEx(aBitmap);
return BitmapEx();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment