From e40443f7dfaa77e1295390385ef76f9b4e87c59b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 11 May 2011 17:34:12 +0200 Subject: 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 (cherry picked from commit 1c5da7207a21cc44a4a08d291c290ffcd9b958fd) --- tests/auto/qimage/tst_qimage.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/auto/qimage/tst_qimage.cpp') diff --git a/tests/auto/qimage/tst_qimage.cpp b/tests/auto/qimage/tst_qimage.cpp index c5ded0d158..ad85bf5cce 100644 --- a/tests/auto/qimage/tst_qimage.cpp +++ b/tests/auto/qimage/tst_qimage.cpp @@ -151,6 +151,7 @@ private slots: void rgbSwapped(); void deepCopyWhenPaintingActive(); + void scaled_QTBUG19157(); }; tst_QImage::tst_QImage() @@ -2029,5 +2030,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" -- cgit v1.2.3