Bug 344023. Clamp offscreen buffer size to avoid crashes on huge windows. r+sr=roc

This commit is contained in:
Michael Ventnor 2008-12-03 14:18:58 +13:00
parent 98ae77c3c1
commit d920855c2b

View File

@ -2213,6 +2213,11 @@ nsWindow::OnExposeEvent(GtkWidget *aWidget, GdkEventExpose *aEvent)
depth = gdk_drawable_get_depth(GDK_DRAWABLE(mDrawingarea->inner_window));
}
// Make sure we won't create something that will overload the X server
nsSize safeSize = GetSafeWindowSize(boundsRect.Size());
boundsRect.width = safeSize.width;
boundsRect.height = safeSize.height;
if (!gUseBufferPixmap ||
boundsRect.width > gBufferPixmapMaxSize.width ||
boundsRect.height > gBufferPixmapMaxSize.height)