Index: Source/core/layout/svg/SVGTextLayoutEngine.cpp |
diff --git a/Source/core/layout/svg/SVGTextLayoutEngine.cpp b/Source/core/layout/svg/SVGTextLayoutEngine.cpp |
index 36d860b289ff2f66a0434c57e9e114383caacbb1..79956449be86a1beeb6dde89c195033f827e847d 100644 |
--- a/Source/core/layout/svg/SVGTextLayoutEngine.cpp |
+++ b/Source/core/layout/svg/SVGTextLayoutEngine.cpp |
@@ -357,7 +357,7 @@ void SVGTextLayoutEngine::layoutTextOnLineOrPath(SVGInlineTextBox* textBox, cons |
// Main layout algorithm. |
const unsigned boxEndOffset = textBox->start() + textBox->len(); |
- while (m_visualMetricsIterator.characterOffset() < boxEndOffset) { |
+ while (!m_visualMetricsIterator.isAtEnd() && m_visualMetricsIterator.characterOffset() < boxEndOffset) { |
const SVGTextMetrics& visualMetrics = m_visualMetricsIterator.metrics(); |
if (visualMetrics.isEmpty()) { |
m_visualMetricsIterator.next(); |