Index: Source/core/svg/SVGTextContentElement.cpp |
diff --git a/Source/core/svg/SVGTextContentElement.cpp b/Source/core/svg/SVGTextContentElement.cpp |
index 532b74b7f23ce518915280da0781107afcd1302b..48c806af588f9d6e7c80f581da57f089d7da1f5f 100644 |
--- a/Source/core/svg/SVGTextContentElement.cpp |
+++ b/Source/core/svg/SVGTextContentElement.cpp |
@@ -123,6 +123,9 @@ float SVGTextContentElement::getSubStringLength(unsigned charnum, unsigned nchar |
return 0.0f; |
} |
+ if (nchars > numberOfChars - charnum) |
+ nchars = numberOfChars - charnum; |
+ |
return SVGTextQuery(renderer()).subStringLength(charnum, nchars); |
} |