diff options
Diffstat (limited to 'tests/auto/gui/painting/qpainter/tst_qpainter.cpp')
-rw-r--r-- | tests/auto/gui/painting/qpainter/tst_qpainter.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp index 51c261fc6a..085aef6019 100644 --- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp +++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp @@ -229,6 +229,7 @@ private slots: void drawImage_task217400(); void drawImage_1x1(); void drawImage_task258776(); + void drawImage_QTBUG28324(); void drawRect_task215378(); void drawRect_task247505(); @@ -3233,6 +3234,25 @@ void tst_QPainter::drawImage_task258776() QCOMPARE(dest, expected); } +void tst_QPainter::drawImage_QTBUG28324() +{ + QImage dest(512, 512, QImage::Format_ARGB32_Premultiplied); + dest.fill(0x0); + + int x = 263; int y = 89; int w = 61; int h = 39; + + QImage source(w, h, QImage::Format_ARGB32_Premultiplied); + quint32 *b = (quint32 *)source.bits(); + for (int j = 0; j < w * h; ++j) + b[j] = 0x7f7f7f7f; + + // nothing to test here since the bug is about + // an invalid memory read, which valgrind + // would complain about + QPainter p(&dest); + p.drawImage(x, y, source); +} + void tst_QPainter::clipRectSaveRestore() { QImage img(64, 64, QImage::Format_ARGB32_Premultiplied); |