Bug 1011574 - Throw the right exception when putImageData is passed an ImageData with a neutered buffer. r=bjacob

This commit is contained in:
Walter Litwinczyk 2014-06-05 11:19:22 -07:00
parent a47d198749
commit 736f4d5851

View File

@ -4046,7 +4046,7 @@ CanvasRenderingContext2D::PutImageData_explicit(int32_t x, int32_t y, uint32_t w
int32_t dirtyWidth, int32_t dirtyHeight)
{
if (w == 0 || h == 0) {
return NS_ERROR_DOM_SYNTAX_ERR;
return NS_ERROR_DOM_INVALID_STATE_ERR;
}
IntRect dirtyRect;
@ -4100,7 +4100,7 @@ CanvasRenderingContext2D::PutImageData_explicit(int32_t x, int32_t y, uint32_t w
uint32_t len = w * h * 4;
if (dataLen != len) {
return NS_ERROR_DOM_SYNTAX_ERR;
return NS_ERROR_DOM_INVALID_STATE_ERR;
}
nsRefPtr<gfxImageSurface> imgsurf = new gfxImageSurface(gfxIntSize(w, h),