bug 378336. nsCanvasRenderingContext2D::GetInputStream uses wrong allocator. r+sr=roc

This commit is contained in:
sayrer@gmail.com 2007-04-22 21:11:04 -07:00
parent 3269deff39
commit f21ac0b126

View File

@ -1091,7 +1091,7 @@ nsCanvasRenderingContext2D::GetInputStream(const nsACString& aMimeType,
imgIEncoder::INPUT_FORMAT_HOSTARGB,
aEncoderOptions);
} else {
nsAutoArrayPtr<PRUint8> imageBuffer((PRUint8*) PR_Malloc(sizeof(PRUint8) * mWidth * mHeight * 4));
nsAutoArrayPtr<PRUint8> imageBuffer(new PRUint8[mWidth * mHeight * 4]);
if (!imageBuffer)
return NS_ERROR_FAILURE;