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

QPixmap::loadFromData crashes with QCoreApplication

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.9.4
    • 5.5.1
    • Image formats
    • None
    • Qt 5.5.1, Windows, MSVC 2013, QCoreApplication, CONFIG += console

    Description

      I have a server application (using QCoreApplication) which is trying to load some data into QPixmap using QPixmap::loadFromData(loadFromData(const QByteArray &buf, const char *format, Qt::ImageConversionFlags flags).

      It crashes with the following stack trace (MSVC 2013);:

       	Qt5Guid.dll!QPlatformPixmap::create(int w=0, int h=0, QPlatformPixmap::PixelType type=PixmapType) Line 55	C++
       	Qt5Guid.dll!QPixmap::loadFromData(const unsigned char * buf=0x0344b068, unsigned int len=3584, const char * format=0x00000000, QFlags<enum Qt::ImageConversionFlag> flags={...}) Line 827	C++
       	Qt5Guid.dll!QPixmap::loadFromData(const QByteArray & buf={...}, const char * format=0x00000000, QFlags<enum Qt::ImageConversionFlag> flags={...}) Line 214	C++
      

      It works fine if I use a QApplication instead of QCoreApplication.

      This looks similar to QTBUG-17873 from Qt 4.x, but that fix doesn't seem to be in 5.5.1.

      It doesn't seem to be documented anywhere that QPixmap requires a QApplication.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-53572
          # Subject Branch Project Status CR V

          Activity

            People

              vgt Eirik Aavitsland
              hmoffatt Hamish Moffatt
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes