From 6a2224fd58414a78957104dd654f697c4b2eaa1d Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Fri, 29 May 2020 15:15:01 +0200 Subject: 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 --- src/plugins/imageformats/ico/qicohandler.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/plugins/imageformats/ico') 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; -- cgit v1.2.3