diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2013-03-25 13:06:57 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-06 14:00:20 +0200 |
commit | add8d6a5a12f28869926df8164293d413debd3bd (patch) | |
tree | 0f1962237b4a7fafa82237d2967fdfffd7246308 | |
parent | a2e31061d4a24fceb4d32f4df301150ee1cc8af1 (diff) |
[Qt] REGRESSION(r146630): 8 text related test asserts on debug builds
https://bugs.webkit.org/show_bug.cgi?id=113179
Reviewed by Jocelyn Turcotte.
Test if range.start is within the valid range before testing the value at that point.
* platform/graphics/qt/FontQt.cpp:
(WebCore::Font::initFormatForTextLayout):
Change-Id: I4baf6b0d7fbc49f947799deec04be187bd581153
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146761 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
-rw-r--r-- | Source/WebCore/platform/graphics/qt/FontQt.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/WebCore/platform/graphics/qt/FontQt.cpp b/Source/WebCore/platform/graphics/qt/FontQt.cpp index 96db55c92..3afbb3528 100644 --- a/Source/WebCore/platform/graphics/qt/FontQt.cpp +++ b/Source/WebCore/platform/graphics/qt/FontQt.cpp @@ -252,8 +252,8 @@ void Font::initFormatForTextLayout(QTextLayout* layout, const TextRun& run) cons // To avoid word-spacing on any leading spaces, we exclude them from FormatRange which // word-spacing along with other options would be applied to. This is safe since the other // formatting options does not affect spaces. - unsigned length = layout->text().length(); - for (range.start = 0; treatAsSpace(run[range.start]) && range.start < length; ++range.start) { } + unsigned length = run.length(); + for (range.start = 0; range.start < length && treatAsSpace(run[range.start]); ++range.start) { } range.length = length - range.start; if (m_wordSpacing) |