From a5cded843f495b4276a8289b1324778d97bed5ba Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 11 Feb 2019 10:52:06 +0100 Subject: Avoid creating wide images with negative bytesPerLine The QImage API can not handle images with more bytes per line than what an integer can hold. Fixes: QTBUG-73731 Fixes: QTBUG-73732 Change-Id: Ieed6fec7645661fd58d8d25335f806faaa1bb3e9 Reviewed-by: Thiago Macieira --- tests/auto/gui/image/qimage/tst_qimage.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp index eded206d37..6bc27a6e16 100644 --- a/tests/auto/gui/image/qimage/tst_qimage.cpp +++ b/tests/auto/gui/image/qimage/tst_qimage.cpp @@ -230,6 +230,8 @@ private slots: void convertColorTable(); + void wideImage(); + #if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) void toWinHBITMAP_data(); void toWinHBITMAP(); @@ -3535,6 +3537,24 @@ void tst_QImage::convertColorTable() QCOMPARE(rgb32.pixel(0,0), 0xffffffff); } +void tst_QImage::wideImage() +{ + // QTBUG-73731 and QTBUG-73732 + QImage i(538994187, 2, QImage::Format_ARGB32); + QImage i2(32, 32, QImage::Format_ARGB32); + i2.fill(Qt::white); + + // Test that it doesn't crash: + QPainter painter(&i); + // With the composition mode is SourceOver out it's an invalid write + // With the composition mode is Source it's an invalid read + painter.drawImage(0, 0, i2); + painter.setCompositionMode(QPainter::CompositionMode_Source); + painter.drawImage(0, 0, i2); + + // Qt6: Test that it actually works on 64bit architectures. +} + #if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) QT_BEGIN_NAMESPACE Q_GUI_EXPORT HBITMAP qt_imageToWinHBITMAP(const QImage &p, int hbitmapFormat = 0); -- cgit v1.2.3 From 0f163887b526d00ccdcead907dde042aa370fc16 Mon Sep 17 00:00:00 2001 From: Juha Karjalainen Date: Tue, 19 Feb 2019 13:57:47 +0200 Subject: Fix blacklisting tst_QTimer::basic_chrono() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Blacklisting did not work as blacklist should have contained osx instead macos Change-Id: Ifd76a38d371ccce545eb5df030aaa819b00a5b48 Reviewed-by: Jędrzej Nowacki --- tests/auto/corelib/kernel/qtimer/BLACKLIST | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto') diff --git a/tests/auto/corelib/kernel/qtimer/BLACKLIST b/tests/auto/corelib/kernel/qtimer/BLACKLIST index c31e15f171..16cbab4587 100644 --- a/tests/auto/corelib/kernel/qtimer/BLACKLIST +++ b/tests/auto/corelib/kernel/qtimer/BLACKLIST @@ -2,4 +2,4 @@ windows osx [basic_chrono] -macos +osx -- cgit v1.2.3 From 01f5d41a406b7baf1cb01692c870e5084fc11b1f Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Wed, 20 Feb 2019 13:30:52 +0100 Subject: Make tst_QUdpSocket::lincLocalIPv6 less sadistic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It fails on CI (Windows 10). Given our qabstractsocket disables read notifications/stops emitting readyRead if it already has pending data (unbuffered, aka UDP socket type) - make sure we do not suffer from this. The change does not affect the test's logic (unless the logic was to fail), it just makes it more fail-proof. Change-Id: I6c9b7ded20478f675260872a2a7032b4f356f197 Fixes: QTBUG-73884 Reviewed-by: Edward Welbourne Reviewed-by: Mårten Nordheim (cherry picked from commit d3eb9e944ac73f238b8716bb25b8051377bba946) Reviewed-by: Timur Pocheptsov --- tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp index 8ebb27e58c..707c1acf48 100644 --- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp @@ -1640,15 +1640,14 @@ void tst_QUdpSocket::linkLocalIPv6() sockets << s; } - QUdpSocket neutral; - QVERIFY(neutral.bind(QHostAddress(QHostAddress::AnyIPv6))); - QSignalSpy neutralReadSpy(&neutral, SIGNAL(readyRead())); - QByteArray testData("hello"); foreach (QUdpSocket *s, sockets) { + QUdpSocket neutral; + QVERIFY(neutral.bind(QHostAddress(QHostAddress::AnyIPv6))); + QSignalSpy neutralReadSpy(&neutral, SIGNAL(readyRead())); + QSignalSpy spy(s, SIGNAL(readyRead())); - neutralReadSpy.clear(); QVERIFY(s->writeDatagram(testData, s->localAddress(), neutral.localPort())); QTRY_VERIFY(neutralReadSpy.count() > 0); //note may need to accept a firewall prompt -- cgit v1.2.3