vcl/source/bitmap/BitmapMosaicFilter.cxx | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
New commits: commit a0b549c0081f37aada8e53addf5e0b5929fb4636 Author: Caolán McNamara <caol...@redhat.com> Date: Thu May 3 16:11:37 2018 +0100 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 63a716783a555e91ad3a32f25f20cffc88ca15e4 Author: Chris Sherlock <chris.sherloc...@gmail.com> Date: Fri Apr 20 20:39:48 2018 +1000 vcl: ImplMosaic() -> BitmapMosaicFilter Change-Id: Ia0910ae9166c4eb6b870ab25db761bc1703fec68 Reviewed-on: https://gerrit.libreoffice.org/53203 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> Change-Id: I4eb74ef279b2ead268d07ac572ab76cd911dacb6 Reviewed-on: https://gerrit.libreoffice.org/53807 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/source/bitmap/BitmapMosaicFilter.cxx b/vcl/source/bitmap/BitmapMosaicFilter.cxx index f17a25ff2283..496d687ef4e3 100644 --- a/vcl/source/bitmap/BitmapMosaicFilter.cxx +++ b/vcl/source/bitmap/BitmapMosaicFilter.cxx @@ -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(); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits