-
Bug
-
Resolution: Done
-
P1: Critical
-
4.8.4
-
None
-
Mac OS X
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.