summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2020-02-24 12:00:21 +0100
committerEirik Aavitsland <eirik.aavitsland@qt.io>2020-02-24 13:06:01 +0100
commit0c4d4dc12a68124451113e21d2c4fdc5d06d01d0 (patch)
tree6ad2a4603f46c12d5e54243394fc3f87e52e410c
parent9584748fc6847240fd6b748e6735e91e451b8958 (diff)
tiff: do not try to read 32bpc as 16bpc
The header reader would assume that bits per sample above 8 had to be 16, but other values are also possible, so check explicitly. Fixes: QTBUG-82412 Change-Id: I7f0799de4d4cdc84023a34900aa595a7bf73eca1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--src/plugins/imageformats/tiff/qtiffhandler.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/imageformats/tiff/qtiffhandler.cpp b/src/plugins/imageformats/tiff/qtiffhandler.cpp
index 65873e1..1099ac5 100644
--- a/src/plugins/imageformats/tiff/qtiffhandler.cpp
+++ b/src/plugins/imageformats/tiff/qtiffhandler.cpp
@@ -278,7 +278,7 @@ bool QTiffHandlerPrivate::readHeaders(QIODevice *device)
else if ((grayscale || photometric == PHOTOMETRIC_PALETTE) && bitPerSample == 8 && samplesPerPixel == 1)
format = QImage::Format_Indexed8;
else if (samplesPerPixel < 4)
- if (bitPerSample > 8 && photometric == PHOTOMETRIC_RGB)
+ if (bitPerSample == 16 && photometric == PHOTOMETRIC_RGB)
format = QImage::Format_RGBX64;
else
format = QImage::Format_RGB32;
@@ -294,7 +294,7 @@ bool QTiffHandlerPrivate::readHeaders(QIODevice *device)
if (!gotField || !count || extrasamples[0] == EXTRASAMPLE_UNSPECIFIED)
premultiplied = false;
- if (bitPerSample > 8 && photometric == PHOTOMETRIC_RGB) {
+ if (bitPerSample == 16 && photometric == PHOTOMETRIC_RGB) {
// We read 64-bit raw, so unassoc remains unpremultiplied.
if (gotField && count && extrasamples[0] == EXTRASAMPLE_UNASSALPHA)
premultiplied = false;