diff --git a/mozilla/layout/generic/nsHTMLContainerFrame.h b/mozilla/layout/generic/nsHTMLContainerFrame.h
index d4ac84b991a..0d61d6e3bda 100644
--- a/mozilla/layout/generic/nsHTMLContainerFrame.h
+++ b/mozilla/layout/generic/nsHTMLContainerFrame.h
@@ -29,7 +29,10 @@ struct nsStylePosition;
// width/height/x/y values computed during reflow.
#ifdef DEBUG
#define CRAZY_W 500000
-#define CRAZY_H 500000
+
+// 100000 lines, approximately. Assumes p2t is 15 and 15 pixels per line
+#define CRAZY_H 22500000
+
#define CRAZY_WIDTH(_x) (((_x) < -CRAZY_W) || ((_x) > CRAZY_W))
#define CRAZY_HEIGHT(_y) (((_y) < -CRAZY_H) || ((_y) > CRAZY_H))
#endif
diff --git a/mozilla/layout/html/base/src/nsHTMLContainerFrame.h b/mozilla/layout/html/base/src/nsHTMLContainerFrame.h
index d4ac84b991a..0d61d6e3bda 100644
--- a/mozilla/layout/html/base/src/nsHTMLContainerFrame.h
+++ b/mozilla/layout/html/base/src/nsHTMLContainerFrame.h
@@ -29,7 +29,10 @@ struct nsStylePosition;
// width/height/x/y values computed during reflow.
#ifdef DEBUG
#define CRAZY_W 500000
-#define CRAZY_H 500000
+
+// 100000 lines, approximately. Assumes p2t is 15 and 15 pixels per line
+#define CRAZY_H 22500000
+
#define CRAZY_WIDTH(_x) (((_x) < -CRAZY_W) || ((_x) > CRAZY_W))
#define CRAZY_HEIGHT(_y) (((_y) < -CRAZY_H) || ((_y) > CRAZY_H))
#endif