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

Unified Diff: Source/core/layout/style/LayoutStyle.cpp

Issue 1016863002: Fix integer overflow in ComputedStyle::computedLineHeight (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Different approach Created 5 years, 9 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/layout/style/LayoutStyle.cpp
diff --git a/Source/core/layout/style/LayoutStyle.cpp b/Source/core/layout/style/LayoutStyle.cpp
index 238f0ee44cbabd0726dd4a26f7933e36a6fd9ace..316f1305f00314447d1b74427ba7f63d6d35b7ef 100644
--- a/Source/core/layout/style/LayoutStyle.cpp
+++ b/Source/core/layout/style/LayoutStyle.cpp
@@ -1254,9 +1254,9 @@ int LayoutStyle::computedLineHeight() const
return fontMetrics().lineSpacing();
if (lh.isPercent())
- return minimumValueForLength(lh, fontSize());
+ return LayoutUnit::clamp(minimumValueForLength(lh, fontSize()));
pdr. 2015/03/18 03:49:42 This fix seems too deep if it's only for shapes. D
- return lh.value();
+ return std::min(static_cast<double>(std::numeric_limits<int>::max()), static_cast<double>(lh.value()));
}
void LayoutStyle::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