Kaydet (Commit) 68b0a61f authored tarafından Julien Nabet's avatar Julien Nabet Kaydeden (comit) Noel Grandin

Related tdf#101467: fix a leak with pSalMask (vcl/bitmapex)

+ initialize pSalBmp+pSalMask to nullptr

Change-Id: I320e9cf98ef8224e98303bec1e58f59dc5b1ad4e
Reviewed-on: https://gerrit.libreoffice.org/41097Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 1a6d6171
......@@ -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;
}
......
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