summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qxbmhandler.cpp
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2020-06-05 16:09:43 +0200
committerEirik Aavitsland <eirik.aavitsland@qt.io>2020-06-26 15:24:05 +0200
commit1a63409579ff0e9ce524c09701c1ef8bd2d99f25 (patch)
treed6a77e05c987fc6f6aef9f68e5a1a2f1e6731260 /src/gui/image/qxbmhandler.cpp
parent5dea4fe956c452be5aae2c61dd0777fdf1efe5d0 (diff)
QImageIO: use the new allocation checker in the format handlers
Change-Id: I604d99ce476d4758a1e20b78257082911f1f1546 Task-number: QTBUG-85037 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui/image/qxbmhandler.cpp')
-rw-r--r--src/gui/image/qxbmhandler.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/gui/image/qxbmhandler.cpp b/src/gui/image/qxbmhandler.cpp
index c422826035..1de045730f 100644
--- a/src/gui/image/qxbmhandler.cpp
+++ b/src/gui/image/qxbmhandler.cpp
@@ -147,11 +147,8 @@ static bool read_xbm_body(QIODevice *device, int w, int h, QImage *outImage)
p = strstr(buf, "0x");
} while (!p);
- if (outImage->size() != QSize(w, h) || outImage->format() != QImage::Format_MonoLSB) {
- *outImage = QImage(w, h, QImage::Format_MonoLSB);
- if (outImage->isNull())
- return false;
- }
+ if (!QImageIOHandler::allocateImage(QSize(w, h), QImage::Format_MonoLSB, outImage))
+ return false;
outImage->fill(Qt::color0); // in case the image data does not cover the full image