b=492724 followup; put back original CheckSaneSubrectSize

This commit is contained in:
Vladimir Vukicevic 2009-06-25 14:12:57 -07:00
parent 4734a09527
commit 408d89bc73

View File

@ -56,7 +56,14 @@ public:
static PRBool CheckSaneSubrectSize(PRInt32 x, PRInt32 y, PRInt32 w, PRInt32 h,
PRInt32 realWidth, PRInt32 realHeight)
{
return nsIntRect(0, 0, realWidth, realHeight).Contains(nsIntRect(x, y, w, h));
if (w <= 0 || h <= 0 || x < 0 || y < 0)
return PR_FALSE;
if (x >= realWidth || w > (realWidth - x) ||
y >= realHeight || h > (realHeight - y))
return PR_FALSE;
return PR_TRUE;
}
// Flag aCanvasElement as write-only if drawing an image with aPrincipal