Changeset 146761 in webkit


Ignore:
Timestamp:
Mar 25, 2013 6:06:57 AM (11 years ago)
Author:
allan.jensen@digia.com
Message:

[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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r146760 r146761  
     12013-03-25  Allan Sandfeld Jensen  <allan.jensen@digia.com>
     2
     3        [Qt] REGRESSION(r146630): 8 text related test asserts on debug builds
     4        https://bugs.webkit.org/show_bug.cgi?id=113179
     5
     6        Reviewed by Jocelyn Turcotte.
     7
     8        Test if range.start is within the valid range before testing the value at that point.
     9
     10        * platform/graphics/qt/FontQt.cpp:
     11        (WebCore::Font::initFormatForTextLayout):
     12
    1132013-03-25  Alexander Pavlov  <apavlov@chromium.org>
    214
  • trunk/Source/WebCore/platform/graphics/qt/FontQt.cpp

    r146630 r146761  
    253253    // word-spacing along with other options would be applied to. This is safe since the other
    254254    // formatting options does not affect spaces.
    255     unsigned length = layout->text().length();
    256     for (range.start = 0; treatAsSpace(run[range.start]) && range.start < length; ++range.start) { }
     255    unsigned length = run.length();
     256    for (range.start = 0; range.start < length && treatAsSpace(run[range.start]); ++range.start) { }
    257257    range.length = length - range.start;
    258258
Note: See TracChangeset for help on using the changeset viewer.