Fix crasher bug 36834 by making sure that the image we're about

to read/composite overlaps the underlying drawing surface. a=brendan
This commit is contained in:
tor%cs.brown.edu 2000-05-20 04:03:17 +00:00
parent 528cf844b7
commit 94713681c6

View File

@ -669,9 +669,11 @@ nsImageGTK::DrawComposited(nsIRenderingContext &aContext,
readX = aX; readY = aY;
destX = 0; destY = 0;
if ((readY>=(int)surfaceHeight) || (readX>=(int)surfaceWidth)) {
if ((readY>=(int)surfaceHeight) || (readX>=(int)surfaceWidth) ||
(readY+aHeight<0) || (readX+aWidth<0)) {
// This should never happen if the layout engine is sane,
// but pavlov says he saw it. Bulletproof gfx for now...
// as it means we're trying to draw an image which is outside
// the drawing surface. Bulletproof gfx for now...
return;
}
if (readY<0) {