summaryrefslogtreecommitdiffstats
path: root/tests/auto/qimagereader
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2010-09-20 10:39:27 (GMT)
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2010-09-20 12:30:03 (GMT)
commit5220c371176951e12d525ac7908861d111c367d0 (patch)
treedc7787e72a19cb9ce31dcd0a20dc0e2def00c3eb /tests/auto/qimagereader
parent0fd2c492ee2e8317a5fbb0fb446816df53d5b17b (diff)
downloadQt-5220c371176951e12d525ac7908861d111c367d0.zip
Qt-5220c371176951e12d525ac7908861d111c367d0.tar.gz
Qt-5220c371176951e12d525ac7908861d111c367d0.tar.bz2
Fixed infinite loop when loading jpeg without EOI from memory.
Task-number: QTBUG-13653 Reviewed-by: aavit
Diffstat (limited to 'tests/auto/qimagereader')
-rw-r--r--tests/auto/qimagereader/images/qtbug13653-no_eoi.jpgbin0 -> 8250 bytes
-rw-r--r--tests/auto/qimagereader/qimagereader.qrc1
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp5
3 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/qimagereader/images/qtbug13653-no_eoi.jpg b/tests/auto/qimagereader/images/qtbug13653-no_eoi.jpg
new file mode 100644
index 0000000..605e8a8
--- /dev/null
+++ b/tests/auto/qimagereader/images/qtbug13653-no_eoi.jpg
Binary files differ
diff --git a/tests/auto/qimagereader/qimagereader.qrc b/tests/auto/qimagereader/qimagereader.qrc
index 1acc82f..5536b38 100644
--- a/tests/auto/qimagereader/qimagereader.qrc
+++ b/tests/auto/qimagereader/qimagereader.qrc
@@ -63,5 +63,6 @@
<file>images/rect.svgz</file>
<file>images/corrupt.svg</file>
<file>images/corrupt.svgz</file>
+ <file>images/qtbug13653-no_eoi.jpg</file>
</qresource>
</RCC>
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index 5b30b04..3bee5d9 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -239,6 +239,7 @@ void tst_QImageReader::readImage_data()
#if defined QTEST_HAVE_JPEG
QTest::newRow("JPEG: beavis") << QString("beavis.jpg") << true << QByteArray("jpeg");
+ QTest::newRow("JPEG: qtbug13653") << QString("qtbug13653-no_eoi.jpg") << true << QByteArray("jpeg");
#endif
#if defined QTEST_HAVE_GIF
QTest::newRow("GIF: earth") << QString("earth.gif") << true << QByteArray("gif");
@@ -1039,6 +1040,7 @@ void tst_QImageReader::readFromDevice_data()
QTest::newRow("jpeg-1") << QString("beavis.jpg") << QByteArray("jpeg");
QTest::newRow("jpeg-2") << QString("YCbCr_cmyk.jpg") << QByteArray("jpeg");
QTest::newRow("jpeg-3") << QString("YCbCr_rgb.jpg") << QByteArray("jpeg");
+ QTest::newRow("jpeg-4") << QString("qtbug13653-no_eoi.jpg") << QByteArray("jpeg");
#endif // QTEST_HAVE_JPEG
#ifdef QTEST_HAVE_GIF
QTest::newRow("gif-1") << QString("earth.gif") << QByteArray("gif");
@@ -1314,6 +1316,9 @@ void tst_QImageReader::readFromResources_data()
QTest::newRow("YCbCr_rgb.jpg") << QString("YCbCr_rgb.jpg")
<< QByteArray("jpg") << QSize(75, 50)
<< QString("");
+ QTest::newRow("qtbug13653-no_eoi.jpg") << QString("qtbug13653-no_eoi.jpg")
+ << QByteArray("jpg") << QSize(240, 180)
+ << QString("");
#endif
#ifdef QTEST_HAVE_MNG
QTest::newRow("corrupt.mng") << QString("corrupt.mng")