summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/image/qbmphandler.cpp6
-rw-r--r--src/plugins/imageformats/ico/qicohandler.cpp6
2 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/image/qbmphandler.cpp b/src/gui/image/qbmphandler.cpp
index 7257853c3e..396bb1964e 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) {
diff --git a/src/plugins/imageformats/ico/qicohandler.cpp b/src/plugins/imageformats/ico/qicohandler.cpp
index 4908850cc5..701da0c06e 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;