diff --git a/mozilla/gfx/src/nsRegion.cpp b/mozilla/gfx/src/nsRegion.cpp index 41088d6268d..2e74c2791e2 100644 --- a/mozilla/gfx/src/nsRegion.cpp +++ b/mozilla/gfx/src/nsRegion.cpp @@ -1289,11 +1289,13 @@ void nsRegion::SimpleSubtract (const nsRect& aRect) if (aRect.IsEmpty()) return; + // protect against aRect being one of our own rectangles + nsRect param = aRect; RgnRect* r = mRectListHead.next; while (r != &mRectListHead) { RgnRect* next = r->next; - if (aRect.Contains(*r)) { + if (param.Contains(*r)) { delete Remove(r); } r = next;