mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 578357 - Use fallible allocation for image frames.r=joe,cjones;a=blocker
This commit is contained in:
parent
c8266d2dc1
commit
9b62c35018
@ -98,9 +98,12 @@ gfxImageSurface::gfxImageSurface(const gfxIntSize& size, gfxImageFormat format)
|
||||
|
||||
// if we have a zero-sized surface, just leave mData nsnull
|
||||
if (mSize.height * mStride > 0) {
|
||||
mData = (unsigned char *) calloc(mSize.height, mStride);
|
||||
|
||||
// Use the fallible allocator here
|
||||
mData = (unsigned char *) moz_malloc(mSize.height * mStride);
|
||||
if (!mData)
|
||||
return;
|
||||
memset(mData, 0, mSize.height * mStride);
|
||||
}
|
||||
|
||||
mOwnsData = PR_TRUE;
|
||||
|
@ -216,7 +216,8 @@ nsresult imgFrame::Init(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
mPalettedImageData = (PRUint8*)PR_MALLOC(PaletteDataLength() + GetImageDataLength());
|
||||
// Use the fallible allocator here
|
||||
mPalettedImageData = (PRUint8*)moz_malloc(PaletteDataLength() + GetImageDataLength());
|
||||
NS_ENSURE_TRUE(mPalettedImageData, NS_ERROR_OUT_OF_MEMORY);
|
||||
} else {
|
||||
// For Windows, we must create the device surface first (if we're
|
||||
|
Loading…
Reference in New Issue
Block a user