Index: third_party/WebKit/Source/core/layout/LayoutText.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutText.cpp b/third_party/WebKit/Source/core/layout/LayoutText.cpp |
index 2dbaf857cf174032c1a2b13fbfcf7879d8ff693e..8d3e6d24adf9a0871ac1f35682ed773fbb13b959 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutText.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutText.cpp |
@@ -1575,7 +1575,7 @@ float LayoutText::width(unsigned from, unsigned len, LayoutUnit xPos, TextDirect |
if (from >= textLength()) |
return 0; |
- if (from + len > textLength()) |
+ if (len > textLength() || from + len > textLength()) |
len = textLength() - from; |
return width(from, len, style(firstLine)->font(), xPos, textDirection, fallbackFonts, glyphBounds); |