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

Unified Diff: Source/core/rendering/AbstractInlineTextBox.cpp

Issue 542553002: Fix crash when trying to iterate over words in an inline text box of length zero. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Got rid of assert, updated fixme Created 6 years, 3 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/accessibility/inline-text-word-boundary-causes-crash-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/rendering/AbstractInlineTextBox.cpp
diff --git a/Source/core/rendering/AbstractInlineTextBox.cpp b/Source/core/rendering/AbstractInlineTextBox.cpp
index becc7cfbdff3b10b01113e25d1aa2b70def91fde..81a40048a484a9aaf1364d5f2795dbf111d9e685 100644
--- a/Source/core/rendering/AbstractInlineTextBox.cpp
+++ b/Source/core/rendering/AbstractInlineTextBox.cpp
@@ -132,6 +132,11 @@ void AbstractInlineTextBox::wordBoundaries(Vector<WordBoundaries>& words) const
String text = this->text();
int len = text.length();
TextBreakIterator* iterator = wordBreakIterator(text, 0, len);
+
+ // FIXME: When http://crbug.com/411764 is fixed, replace this with an ASSERT.
+ if (!iterator)
+ return;
+
int pos = iterator->first();
while (pos >= 0 && pos < len) {
int next = iterator->next();
« no previous file with comments | « LayoutTests/accessibility/inline-text-word-boundary-causes-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698