summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qimage_conversions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/image/qimage_conversions.cpp')
-rw-r--r--src/gui/image/qimage_conversions.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/image/qimage_conversions.cpp b/src/gui/image/qimage_conversions.cpp
index 519885b437..e1d3101174 100644
--- a/src/gui/image/qimage_conversions.cpp
+++ b/src/gui/image/qimage_conversions.cpp
@@ -1144,7 +1144,7 @@ static QVector<QRgb> fix_color_table(const QVector<QRgb> &ctbl, QImage::Format f
if (format == QImage::Format_RGB32) {
// check if the color table has alpha
for (int i = 0; i < colorTable.size(); ++i)
- if (qAlpha(colorTable.at(i) != 0xff))
+ if (qAlpha(colorTable.at(i)) != 0xff)
colorTable[i] = colorTable.at(i) | 0xff000000;
} else if (format == QImage::Format_ARGB32_Premultiplied) {
// check if the color table has alpha
@@ -1746,8 +1746,9 @@ static void convert_Indexed8_to_X32(QImageData *dest, const QImageData *src, Qt:
if (colorTable.size() < 256) {
int tableSize = colorTable.size();
colorTable.resize(256);
+ QRgb fallbackColor = (dest->format == QImage::Format_RGB32) ? 0xff000000 : 0;
for (int i=tableSize; i<256; ++i)
- colorTable[i] = 0;
+ colorTable[i] = fallbackColor;
}
int w = src->width;