diff --git a/mozilla/gfx/src/gtk/nsImageGTK.cpp b/mozilla/gfx/src/gtk/nsImageGTK.cpp index 43586193bca..6267fc4e0d0 100644 --- a/mozilla/gfx/src/gtk/nsImageGTK.cpp +++ b/mozilla/gfx/src/gtk/nsImageGTK.cpp @@ -627,12 +627,12 @@ nsImageGTK::DrawCompositedGeneral(PRBool isLSB, PRBool flipBytes, } // now composite - for (int y=0; y>8; targetRow[3*i+1] = (unsigned(targetRow[3*i+1])*(255-alphaRow[i]) + @@ -669,6 +669,11 @@ nsImageGTK::DrawComposited(nsIRenderingContext &aContext, readX = aX; readY = aY; destX = 0; destY = 0; + if ((readY>=surfaceHeight) || (readX>=surfaceWidth)) { + // This should never happen if the layout engine is sane, + // but pavlov says he saw it. Bulletproof gfx for now... + return; + } if (readY<0) { destY = -readY; readY = 0;