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

QPainter drawImage can cause crash

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • None
    • 5.9.6, 5.11.1
    • GUI: Painting
    • None
    • Windows
    • 9a3359b57b2286286c3a83fcfab79545b3ce114b

    Description

      'QPainter::drawImage()' can cause crash when I use optimized png image

      #include <QApplication>
      #include <QtCore>
      #include <QtGui>
      #include <QPainter>
      
      int main(int argc, char *argv[])
      {
      	QApplication app(argc, argv);
      
      	QImage brush(":/optimized.png");// cause crash
      	//QImage brush(":/non-optimized.png"); //no crash
      	QImage brush2(":/non-optimized.png");
      	QImage *canvas = new QImage(300, 300, QImage::Format_ARGB32_Premultiplied);
      	QPainter painter1(&brush);
      	painter1.drawImage (brush.rect (),brush2);
      
      	QPainter painter2(canvas);
      	painter2.drawImage(QPoint(0,0),brush);// crash here
      
      	return 0;
      }
      

      Attachments

        1. test.zip
          4 kB
          liuping
        2. crash.jpg
          105 kB
          liuping
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vgt Eirik Aavitsland
            liuping liuping
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes