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

QPixmap::loadFromData crashes on invalid data on X11

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.6.1
    • 4.6.0
    • GUI: Painting
    • None
    • dbaea6fa5a90742d89691685baa44a1a34598f21

    Description

      QPixmap::loadFromData crashes on invalid data on X11,
      here is the simple example which reproduces the bug:

      #include <QtGui>

      int main(int argc, char* argv[])
      {
      QApplication app(argc, argv);

      QByteArray data("some incorrect image data");

      QPixmap pixmap;
      pixmap.loadFromData(data);

      return 0;
      }

      Backtrace:

      #0 0xb75ff40b in QImageData::checkForAlphaPixels (this=0x0) at depot/qt/qt/src/gui/image/qimage.cpp:273
      #1 0xb764e9c7 in QX11AlphaDetector::hasAlpha (this=0xbff60b28) at depot/qt/qt/src/gui/image/qpixmap_x11.cpp:385
      #2 0xb764ea1a in QX11AlphaDetector::hasXRenderAndAlpha (this=0xbff60b28) at depot/qt/qt/src/gui/image/qpixmap_x11.cpp:392
      #3 0xb764665d in QX11PixmapData::fromImage (this=0x8088ec0, img=@0xbff60f5c, flags=

      {i = -1074393256}

      )
      at depot/qt/qt/src/gui/image/qpixmap_x11.cpp:443
      #4 0xb76371e2 in QPixmapData::fromData (this=0x8088ec0, buf=0x80716a8 "some incorrect image data", len=25, format=0x0, flags=

      {i = -1074393176}

      )
      at depot/qt/qt/src/gui/image/qpixmapdata.cpp:132
      #5 0xb762d365 in QPixmap::loadFromData (this=0xbff61010, buf=0x80716a8 "some incorrect image data", len=25, format=0x0, flags=

      {i = -1074393120}

      )
      at depot/qt/qt/src/gui/image/qpixmap.cpp:872
      #6 0x08048a12 in QPixmap::loadFromData (this=0xbff61010, buf=@0xbff6101c, format=0x0, flags=

      {i = -1074393048}

      )
      at depot/qt/qt/src/gui/image/qpixmap.h:302
      #7 0x080488c7 in main (argc=0, argv=0xb8035ff4) at testpixmap/main.cpp:10

      Attachments

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

        Activity

          People

            kjernase Trond Kjernåsen (Inactive)
            poplavsk Dmytro Poplavskiy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes