summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-05-09 14:54:41 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2011-05-09 17:47:30 (GMT)
commit1c5da7207a21cc44a4a08d291c290ffcd9b958fd (patch)
tree20041e6e1b8482a38dae3e7e58ad5c5ca0bdf125 /tests
parentbae78d4a2cc32952a19e4da9f0486af635ea6d47 (diff)
downloadQt-1c5da7207a21cc44a4a08d291c290ffcd9b958fd.zip
Qt-1c5da7207a21cc44a4a08d291c290ffcd9b958fd.tar.gz
Qt-1c5da7207a21cc44a4a08d291c290ffcd9b958fd.tar.bz2
Prevent crash in OpenGL engine when scaling images / pixmaps.
Make sure the resulting image / pixmap is valid if the source was valid. Task-number: QTBUG-19157 Reviewed-by: Kim Reviewed-by: Benjamin Poulain
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qimage/tst_qimage.cpp8
-rw-r--r--tests/auto/qpixmap/tst_qpixmap.cpp8
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qimage/tst_qimage.cpp b/tests/auto/qimage/tst_qimage.cpp
index 558dfaa..6bb08b0 100644
--- a/tests/auto/qimage/tst_qimage.cpp
+++ b/tests/auto/qimage/tst_qimage.cpp
@@ -144,6 +144,7 @@ private slots:
void rgbSwapped();
void deepCopyWhenPaintingActive();
+ void scaled_QTBUG19157();
};
tst_QImage::tst_QImage()
@@ -1902,5 +1903,12 @@ void tst_QImage::deepCopyWhenPaintingActive()
QVERIFY(copy != image);
}
+void tst_QImage::scaled_QTBUG19157()
+{
+ QImage foo(5000, 1, QImage::Format_RGB32);
+ foo = foo.scaled(1024, 1024, Qt::KeepAspectRatio);
+ QVERIFY(!foo.isNull());
+}
+
QTEST_MAIN(tst_QImage)
#include "tst_qimage.moc"
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp
index 0b2f527..12d31e3 100644
--- a/tests/auto/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/qpixmap/tst_qpixmap.cpp
@@ -196,6 +196,7 @@ private slots:
#endif
void drawPixmapWhilePainterOpen();
+ void scaled_QTBUG19157();
};
static bool lenientCompare(const QPixmap &actual, const QPixmap &expected)
@@ -1942,5 +1943,12 @@ void tst_QPixmap::drawPixmapWhilePainterOpen()
}
}
+void tst_QPixmap::scaled_QTBUG19157()
+{
+ QPixmap foo(5000, 1);
+ foo = foo.scaled(1024, 1024, Qt::KeepAspectRatio);
+ QVERIFY(!foo.isNull());
+}
+
QTEST_MAIN(tst_QPixmap)
#include "tst_qpixmap.moc"