diff options
-rw-r--r-- | vcl/source/gdi/bitmapex.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index 31da4bbff58c..99186cf04129 100644 --- a/vcl/source/gdi/bitmapex.cxx +++ b/vcl/source/gdi/bitmapex.cxx @@ -788,14 +788,15 @@ bool BitmapEx::Create( const css::uno::Reference< css::rendering::XBitmapCanvas } } - SalBitmap* pSalBmp, *pSalMask; + SalBitmap* pSalBmp = nullptr; + SalBitmap* pSalMask = nullptr; pSalBmp = ImplGetSVData()->mpDefInst->CreateSalBitmap(); - pSalMask = ImplGetSVData()->mpDefInst->CreateSalBitmap(); Size aLocalSize(rSize); if( pSalBmp->Create( xBitmapCanvas, aLocalSize ) ) { + pSalMask = ImplGetSVData()->mpDefInst->CreateSalBitmap(); if ( pSalMask->Create( xBitmapCanvas, aLocalSize, true ) ) { *this = BitmapEx(Bitmap(pSalBmp), Bitmap(pSalMask) ); @@ -803,6 +804,7 @@ bool BitmapEx::Create( const css::uno::Reference< css::rendering::XBitmapCanvas } else { + delete pSalMask; *this = BitmapEx(Bitmap(pSalBmp)); return true; } |