summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qbmphandler.cpp
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2020-05-29 15:15:01 +0200
committerEirik Aavitsland <eirik.aavitsland@qt.io>2020-05-30 12:33:08 +0200
commit6a2224fd58414a78957104dd654f697c4b2eaa1d (patch)
treef0ece8723a83faf5c4e15ef92d7289163173948a /src/gui/image/qbmphandler.cpp
parent30571068b203a9d950030b31ee84f08f2f6fc04d (diff)
bmp/ico decoder: fail early for unsupported bit depths
All the normal bit depths are supported, so no point in trying to go through the decoding code path for others. Avoids wide bitshift warning for claimed depths > 32. Pick-to: 5.15 5.12 Change-Id: I61b72dbbf9558ca28db46f8168339f8174e56997 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/gui/image/qbmphandler.cpp')
-rw-r--r--src/gui/image/qbmphandler.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/image/qbmphandler.cpp b/src/gui/image/qbmphandler.cpp
index d559913161..625ed7c873 100644
--- a/src/gui/image/qbmphandler.cpp
+++ b/src/gui/image/qbmphandler.cpp
@@ -262,9 +262,13 @@ static bool read_dib_body(QDataStream &s, const BMP_INFOHDR &bi, qint64 offset,
depth = 8;
format = QImage::Format_Indexed8;
break;
- default:
+ case 1:
depth = 1;
format = QImage::Format_Mono;
+ break;
+ default:
+ return false;
+ break;
}
if (depth != 32) {