diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-10-14 18:22:14 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-10-16 21:41:07 +0000 |
commit | d7cd50b34731357a30421bbd8561d7fa2e576ded (patch) | |
tree | 8da6c4ba50ef6f40f5932adf83c35ea9f0e411b1 | |
parent | d7bdc138b89bf0c52ba9ddf22b34d2ccd06b3936 (diff) | |
download | qtimageformats-d7cd50b34731357a30421bbd8561d7fa2e576ded.tar.gz |
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 <giuseppe.dangelo@kdab.com>
-rw-r--r-- | src/plugins/imageformats/dds/qddshandler.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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); } } |