diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index e66e6a8d8d3f..7a313bc0c1ac 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -677,7 +677,7 @@ nsHTMLScrollFrame::GetPrefWidth(nsIRenderingContext *aRenderingContext) nsSize vScrollbarPrefSize(0, 0); GetScrollbarMetrics(bls, mInner.mVScrollbarBox, nsnull, &vScrollbarPrefSize, PR_TRUE); - result += vScrollbarPrefSize.width; + result = NSCoordSaturatingAdd(result, vScrollbarPrefSize.width); } return result;