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

QPainter::drawPixmap crash, possible pointer double deletion...

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.8.5
    • 4.8.4
    • GUI: Painting
    • None
    • Mac OS X

    Description

      QPainter::drawPixmap crash can be reproduced using Scribble example and modifying the print method as shown below.

      void ScribbleArea::print()
      {
      #ifndef QT_NO_PRINTER
          QPrinter printer(QPrinter::HighResolution);
       
          QPrintDialog printDialog(&printer, this);
      //! [21] //! [22]
          if (printDialog.exec() == QDialog::Accepted) {
              QPainter painter(&printer);
              QRect rect = painter.viewport();
      
              QPixmap pm(15*logicalDpiX(), 15*logicalDpiY());
              pm.fill(Qt::blue);
              painter.drawPixmap(rect, pm);
          }
      #endif // QT_NO_PRINTER
      }
      

      Demo application will crash and throws the following error message:
      Application Specific Information:
      error for object 0x10bfbf000: pointer being freed was not allocated.

      Full crashlog attached to attachments.

      Steps to reproduce:

      • open scribble application
      • draw a nice picture
      • select File -> Print
      • from the print dialog, select "Save as Pdf..." and save the file

      Expected behaviour:

      • Nice picture is being saved

      Actual behaviour:

      • Crash happens

      Notes:
      This issue is NOT valid on Qt5.01.

      Attachments

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

        Activity

          People

            sorvig Morten Sørvig
            qtcomsupport Qt Support
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes