coverity#1325067 Resource leak

Change-Id: I1db24c81a2698ff49dd2441ddd1bc94a1a3e6f58
This commit is contained in:
Caolán McNamara 2015-09-29 10:19:14 +01:00
parent 1faa4dd2fb
commit acf83365fc

View File

@ -748,8 +748,13 @@ bool ImplReadDIBBody( SvStream& rIStm, Bitmap& rBmp, Bitmap* pBmpAlpha, sal_uLon
BitmapPalette aDummyPal;
Bitmap aNewBmp(aSizePixel, nBitCount, &aDummyPal);
BitmapWriteAccess* pAcc = aNewBmp.AcquireWriteAccess();
if (!pAcc || pAcc->Width() != aHeader.nWidth || pAcc->Height() != aHeader.nHeight)
if (!pAcc)
return false;
if (pAcc->Width() != aHeader.nWidth || pAcc->Height() != aHeader.nHeight)
{
Bitmap::ReleaseAccess(pAcc);
return false;
}
Bitmap aNewBmpAlpha;
BitmapWriteAccess* pAccAlpha = 0;
bool bAlphaPossible(pBmpAlpha && aHeader.nBitCount == 32);