Changeset 72788 in webkit


Ignore:
Timestamp:
Nov 29, 2010 4:05:56 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2010-11-29 Jan Erik Hanssen <jhanssen@sencha.com>

Reviewed by Kenneth Rohde Christiansen.

QtWebKit asserts when selecting elided text.
https://bugs.webkit.org/show_bug.cgi?id=45391

Ensure that the length passed to fromRawDataWithoutRef() does
not exceed the length of the string.

  • platform/graphics/qt/FontQt.cpp: (WebCore::Font::selectionRectForSimpleText):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r72786 r72788  
     12010-11-29  Jan Erik Hanssen  <jhanssen@sencha.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        QtWebKit asserts when selecting elided text.
     6        https://bugs.webkit.org/show_bug.cgi?id=45391
     7
     8        Ensure that the length passed to fromRawDataWithoutRef() does
     9        not exceed the length of the string.
     10
     11        * platform/graphics/qt/FontQt.cpp:
     12        (WebCore::Font::selectionRectForSimpleText):
     13
    1142010-11-26  Alexander Pavlov  <apavlov@chromium.org>
    215
  • trunk/WebCore/platform/graphics/qt/FontQt.cpp

    r72660 r72788  
    345345    String sanitized = Font::normalizeSpaces(String(run.characters(), run.length()));
    346346    QString wholeText = fromRawDataWithoutRef(sanitized);
    347     QString selectedText = fromRawDataWithoutRef(sanitized, from, to - from);
     347    QString selectedText = fromRawDataWithoutRef(sanitized, from, qMin(to - from, wholeText.length() - from));
    348348
    349349    int startX = QFontMetrics(font()).width(wholeText, from, Qt::TextBypassShaping);
Note: See TracChangeset for help on using the changeset viewer.