summaryrefslogtreecommitdiffstats
path: root/src/plugins/imageformats/ico
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/plugins/imageformats/ico
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/plugins/imageformats/ico')
-rw-r--r--src/plugins/imageformats/ico/qicohandler.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/imageformats/ico/qicohandler.cpp b/src/plugins/imageformats/ico/qicohandler.cpp
index 4c8ff7d489..d7b2fc64c2 100644
--- a/src/plugins/imageformats/ico/qicohandler.cpp
+++ b/src/plugins/imageformats/ico/qicohandler.cpp
@@ -491,8 +491,12 @@ QImage ICOReader::iconAt(int index)
case 4:
icoAttrib.depth = 8;
break;
- default:
+ case 1:
icoAttrib.depth = 1;
+ break;
+ default:
+ return img;
+ break;
}
if (icoAttrib.depth == 32) // there's no colormap
icoAttrib.ncolors = 0;