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

Fontdata gets corrupted with poor /broken network connection resulting in crash while loading a webpage.

    XMLWordPrintable

Details

    • d16508a285a5423ae9a5034e969801bce74ffb98, 909b0de5d16f2af3b3d6a3ca4c7e53b84836ad37

    Description

      This is on windows only.
      Use the attached application to reproduce the problem .
      Click on More Information to load the second page.
      While the page is loading pull out the network connection or switch off the wifi.
      The application crashes.
      This is hard to reproduce as it generally happens with poor internet connection.

      The crash log is attached.

      Using a debug statement as below shows that when it is crashed, one of the fontdata's loaded has wrong size compared with the correct loading.

      --- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
      +++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
      @@ -215,7 +215,7 @@ namespace {
               TableDirectory *nameTableDirectoryEntry = tableDirectoryEntry("name");
               if (nameTableDirectoryEntry == 0)
                   return QString();
      -
      +		qDebug()<<"Changing "<< newFamilyName << m_fontData.size();
               QString oldFamilyName = familyName(nameTableDirectoryEntry);
      

      Checking of Null or trailing with \O doesn't help

      --- a/Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp
      +++ b/Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp
      @@ -28,6 +28,7 @@
       #include "WOFFFileFormat.h"
       #endif
       #include <QStringList>
      +#include <QDebug>
       
       namespace WebCore {
       
      @@ -55,6 +56,9 @@ FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
       #endif // USE(ZLIB)
       
           const QByteArray fontData(buffer->data(), buffer->size());
      +    if(fontData.isNull() || !fontData.endsWith("\0"))
      +		return 0;
      +    qDebug()<<"Font Data Size : "<<fontData.size();
       #if !USE(ZLIB)
           if (fontData.startsWith("wOFF")) {
               qWarning("WOFF support requires QtWebKit to be built with zlib support.");
      

      Attachments

        1. Resize.zip
          2 kB
        2. Logs.zip
          1 kB
        3. FontInfo.zip
          1.05 MB
        4. FontData.txt
          114 kB
        5. fontData.txt
          21 kB
        6. CrashLogs.zip
          2 kB
        7. CrashLog.txt
          917 kB
        8. CallStack.txt
          15 kB

        Issue Links

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

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              tapadar Indrajit Tapadar (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes