Bug 284037 OOM crash [@ nsCairoBlender::GetAlphas]

patch by b.jacques@planet.nl r=roc sr=roc a=asa
This commit is contained in:
timeless%mozdev.org 2005-07-07 15:40:37 +00:00
parent 9a61950459
commit fdaaf22a10

View File

@ -113,6 +113,8 @@ nsCairoBlender::GetAlphas(const nsRect& aRect, nsIDrawingSurface* aBlack,
nsIDrawingSurface* aWhite, PRUint8** aAlphas)
{
*aAlphas = (PRUint8*) nsMemory::Alloc(aRect.width * aRect.height);
NS_ENSURE_TRUE(*aAlphas, NS_ERROR_OUT_OF_MEMORY);
memset(*aAlphas, 0, aRect.width * aRect.height);
return NS_OK;
}