From 1fce33cc48093e0db1850591dee5c985da52ed7a Mon Sep 17 00:00:00 2001 From: "reed%reedloden.com" Date: Sun, 27 Jan 2008 03:55:40 +0000 Subject: [PATCH] Bug 413274 - ""ASSERTION: How can this ever happen?: '*aUnconstrainedSize <= scriptLevelSize'"" [p=vladimir.sukhoy@gmail.com (Vlad Sukhoy) r+sr=roc a1.9=beltzner] git-svn-id: svn://10.0.0.236/trunk@244095 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/style/nsRuleNode.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mozilla/layout/style/nsRuleNode.cpp b/mozilla/layout/style/nsRuleNode.cpp index 5c18741f190..e2c335ce2ed 100644 --- a/mozilla/layout/style/nsRuleNode.cpp +++ b/mozilla/layout/style/nsRuleNode.cpp @@ -1969,12 +1969,15 @@ ComputeScriptLevelSize(const nsStyleFont* aFont, const nsStyleFont* aParentFont, double scriptLevelScale = pow(aParentFont->mScriptSizeMultiplier, scriptLevelChange); - // Compute the size we would have had if minscriptsize had never been applied + // Compute the size we would have had if minscriptsize had never been + // applied, also prevent overflow (bug 413274) *aUnconstrainedSize = - NSToCoordRound(aParentFont->mScriptUnconstrainedSize*scriptLevelScale); + NSToCoordRound(PR_MIN(aParentFont->mScriptUnconstrainedSize*scriptLevelScale, + nscoord_MAX)); // Compute the size we could get via scriptlevel change nscoord scriptLevelSize = - NSToCoordRound(aParentFont->mSize*scriptLevelScale); + NSToCoordRound(PR_MIN(aParentFont->mSize*scriptLevelScale, + nscoord_MAX)); if (scriptLevelScale <= 1.0) { if (aParentFont->mSize <= minScriptSize) { // We can't decrease the font size at all, so just stick to no change