Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1909)

Unified Diff: Source/core/style/ComputedStyle.cpp

Issue 1016863002: Fix integer overflow in ComputedStyle::computedLineHeight (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Clamp explicitly Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/shapes/shape-outside-floats/shape-outside-line-height-crash2-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/style/ComputedStyle.cpp
diff --git a/Source/core/style/ComputedStyle.cpp b/Source/core/style/ComputedStyle.cpp
index be6750a2d58f368f365364f44fa3add27163e796..a4c2f8158858bc44eadb7395ee89f3a0b1e2bfc3 100644
--- a/Source/core/style/ComputedStyle.cpp
+++ b/Source/core/style/ComputedStyle.cpp
@@ -1256,7 +1256,7 @@ int ComputedStyle::computedLineHeight() const
if (lh.isPercent())
return minimumValueForLength(lh, fontSize());
- return lh.value();
+ return std::min(lh.value(), LayoutUnit::max().toFloat());
}
void ComputedStyle::setWordSpacing(float wordSpacing)
« no previous file with comments | « LayoutTests/fast/shapes/shape-outside-floats/shape-outside-line-height-crash2-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698