From d7cd50b34731357a30421bbd8561d7fa2e576ded Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 14 Oct 2016 18:22:14 +0200 Subject: QDDSHandler: fix Coverity warning re:swapped arguments Coverity was clever enough to see that the arguments to qRgba() were swapped, but too dumb to understand the comment right above. Fix the warning by explicitly swapping b and r, and then passing the arguments in the correct order. Coverity-Id: 22421 Change-Id: I87f98ea2bc8745c85fda5dbf0b03a505866ed4ae Reviewed-by: Giuseppe D'Angelo --- src/plugins/imageformats/dds/qddshandler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/imageformats/dds/qddshandler.cpp b/src/plugins/imageformats/dds/qddshandler.cpp index bfd18cd..81e967b 100644 --- a/src/plugins/imageformats/dds/qddshandler.cpp +++ b/src/plugins/imageformats/dds/qddshandler.cpp @@ -990,7 +990,8 @@ static QImage readA2W10V10U10(QDataStream &s, quint32 width, quint32 height) quint8 b = qint8((tmp & 0x000003ff) >> 0 >> 2) + 128; quint8 a = 0xff * ((tmp & 0xc0000000) >> 30) / 3; // dunno why we should swap b and r here - line[x] = qRgba(b, g, r, a); + std::swap(b, r); + line[x] = qRgba(r, g, b, a); } } -- cgit v1.2.3 From 06ee5a2abc560a1041d2c9f80eaa42f5de80a4f9 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Wed, 2 Nov 2016 16:47:05 +0000 Subject: Disable the DDS image format plugin As it stands right now, it's severely bugged and a security minefield (crashes). It is also pretty useless in combination with QImage: DDS files are supposed to carry multiple individual textures, texture arrays, cubemaps; mipmap chains; and may use specific texture compression formats. All these features are not supported at all by QImage. [ChangeLog][QtImageFormats] The DDS image plugin has been disabled due to lack of maintenance. Change-Id: I6e53b1b14de316389813ddd3e34a644065937b4a Reviewed-by: Eirik Aavitsland --- src/plugins/imageformats/imageformats.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/imageformats/imageformats.pro b/src/plugins/imageformats/imageformats.pro index 1ed399a..f93ef13 100644 --- a/src/plugins/imageformats/imageformats.pro +++ b/src/plugins/imageformats/imageformats.pro @@ -1,6 +1,6 @@ TEMPLATE = subdirs SUBDIRS = \ - dds \ +# dds \ icns \ tga \ tiff \ -- cgit v1.2.3 From 7e7aa7a6591222a11a7268f6c73b724a7da1b880 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 15 Oct 2016 00:53:41 +0200 Subject: QWebpHandler/QDDSHandler: init all fields Coverity complained about uninitialised members of m_features in QWebpHandler, and m_header and m_header10 in QDDSHandler, so force value-initialization, in this case zero-initialization, by explicitly adding the fields to the ctor-init-list. Coverity-Id: 21998 Coverity-Id: 22032 Change-Id: Ie45023eda82b7034a0b3e33bab4fb23465cdc7cf Reviewed-by: Giuseppe D'Angelo --- src/plugins/imageformats/dds/qddshandler.cpp | 2 ++ src/plugins/imageformats/webp/qwebphandler.cpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/imageformats/dds/qddshandler.cpp b/src/plugins/imageformats/dds/qddshandler.cpp index 81e967b..f146b95 100644 --- a/src/plugins/imageformats/dds/qddshandler.cpp +++ b/src/plugins/imageformats/dds/qddshandler.cpp @@ -1368,7 +1368,9 @@ static int formatByName(const QByteArray &name) } QDDSHandler::QDDSHandler() : + m_header(), m_format(FormatA8R8G8B8), + m_header10(), m_currentImage(0), m_scanState(ScanNotScanned) { diff --git a/src/plugins/imageformats/webp/qwebphandler.cpp b/src/plugins/imageformats/webp/qwebphandler.cpp index 41a568d..2925574 100644 --- a/src/plugins/imageformats/webp/qwebphandler.cpp +++ b/src/plugins/imageformats/webp/qwebphandler.cpp @@ -42,7 +42,8 @@ static const int riffHeaderSize = 12; // RIFF_HEADER_SIZE from webp/format_const QWebpHandler::QWebpHandler() : m_lossless(false), m_quality(75), - m_scanState(ScanNotScanned) + m_scanState(ScanNotScanned), + m_features() { } -- cgit v1.2.3 From e6deda527721f94133d5715f5c34a170c043f3d1 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 15 Oct 2016 22:23:03 +0200 Subject: QTgaFile: fix parsing of TGA16 rgb data The code tries to expand a 16-bit value of the form 0bABBBBBGGGGGRRRRR into a 32-bit QRgb, but got the operator precedence wrong: << has higher precedence than binary & This made the first operand of the |-chain (BBBBB) unconditionally zero. The second operand had the same precedence problem, but didn't decay into a tautological value like the first one did. Fix by adding another set of parentheses. The test coverage for this security-relevant piece of code is quite obviously insufficient, and should be increased, or else the format be dropped. [ChangeLog][TGA] Fixed reading of TGA-16 formats. Coverity-Id: 21782 Change-Id: I7019be8fe22e480c40192e0c1916b1d2bebf71cc Reviewed-by: Lars Knoll Reviewed-by: Giuseppe D'Angelo --- src/plugins/imageformats/tga/qtgafile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/imageformats/tga/qtgafile.cpp b/src/plugins/imageformats/tga/qtgafile.cpp index a0fc26d..b248b3a 100644 --- a/src/plugins/imageformats/tga/qtgafile.cpp +++ b/src/plugins/imageformats/tga/qtgafile.cpp @@ -52,7 +52,7 @@ struct Tga16Reader : public TgaReader if (s->getChar(&ch1) && s->getChar(&ch2)) { quint16 d = (int(ch1) & 0xFF) | ((int(ch2) & 0xFF) << 8); QRgb result = (d & 0x8000) ? 0xFF000000 : 0x00000000; - result |= (d & 0x7C00 << 6) | (d & 0x03E0 << 3) | (d & 0x001F); + result |= ((d & 0x7C00) << 6) | ((d & 0x03E0) << 3) | (d & 0x001F); return result; } else { return 0; -- cgit v1.2.3 From 16362da5762b2375ac986d19266cef0bcdc5047c Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 3 Nov 2016 18:18:29 +0100 Subject: remove dependencies from sync.profile the CI obtains them from the qt5 super repo nowadays. Change-Id: Iec8d6adc5dc8d0c3d9f4c369d901e0352bd746f1 Reviewed-by: Liang Qi --- sync.profile | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/sync.profile b/sync.profile index 3fad8a6..6d035bc 100644 --- a/sync.profile +++ b/sync.profile @@ -1,10 +1,2 @@ -# Module dependencies. -# Every module that is required to build this module should have one entry. -# Each of the module version specifiers can take one of the following values: -# - A specific Git revision. -# - any git symbolic ref resolvable from the module's repository (e.g. "refs/heads/master" to track master branch) -# - an empty string to use the same branch under test (dependencies will become "refs/heads/master" if we are in the master branch) -# -%dependencies = ( - "qtbase" => "", +%modules = ( # path to module name map ); -- cgit v1.2.3