Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-36651

Calling QString::at(0) on empty string in addFontsToDatabase in qwindowsfontdatabase.cpp

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 5.3.0
    • 5.2.0
    • Core: Plugins
    • None
    • Windows 7 64-bit, Qt Creator, minGW (also msvc)
    • db98d65415b270f49e015154a37a39befc8c752e (dev, 12.2.2014, 5.3)

    Description

      Debug assertion in QString::at() triggered when called from addFontToDatabase() (file qwindowsfontdatabase, line 847) when familyName string is empty.

      Message:
      ASSERT: "uint < uint(size())" in file c:\work\build\qt5_workdir\w\s\qtbase\include\qtcore\../../src/corelib/tools/qstring.h, line 755

      Because of this problem application crashes when debugging with minGW.
      With msvc it is possible to ignore it and continue debugging.

      The problem is most likely caused by a strange font installed on my PC.

      Suggestion for fixing:
      Add check ' familyName.size() > 0 || ' before 'familyName.at(0) == QLatin1Char('@')' to exit if empty string is received.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kleint Friedemann Kleint
            eespdg Domagoj Prelošćan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes