From 27f6a042f8b7fad13a7e0a1e75a25e50cfbd8c47 Mon Sep 17 00:00:00 2001 From: Walter Litwinczyk Date: Thu, 5 Jun 2014 11:19:22 -0700 Subject: [PATCH] Bug 1011574 - Throw the right exception when putImageData is passed an ImageData with a neutered buffer. r=bjacob --- content/canvas/src/CanvasRenderingContext2D.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/canvas/src/CanvasRenderingContext2D.cpp b/content/canvas/src/CanvasRenderingContext2D.cpp index 5071e22bbc0c..395665e196a9 100644 --- a/content/canvas/src/CanvasRenderingContext2D.cpp +++ b/content/canvas/src/CanvasRenderingContext2D.cpp @@ -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 imgsurf = new gfxImageSurface(gfxIntSize(w, h),