diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2020-06-05 16:09:43 +0200 |
---|---|---|
committer | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2020-06-26 15:24:05 +0200 |
commit | 1a63409579ff0e9ce524c09701c1ef8bd2d99f25 (patch) | |
tree | d6a77e05c987fc6f6aef9f68e5a1a2f1e6731260 /src/gui/image/qppmhandler.cpp | |
parent | 5dea4fe956c452be5aae2c61dd0777fdf1efe5d0 (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/qppmhandler.cpp')
-rw-r--r-- | src/gui/image/qppmhandler.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/gui/image/qppmhandler.cpp b/src/gui/image/qppmhandler.cpp index 16136e6be3..afeb403abb 100644 --- a/src/gui/image/qppmhandler.cpp +++ b/src/gui/image/qppmhandler.cpp @@ -160,11 +160,8 @@ static bool read_pbm_body(QIODevice *device, char type, int w, int h, int mcc, Q } raw = type >= '4'; - if (outImage->size() != QSize(w, h) || outImage->format() != format) { - *outImage = QImage(w, h, format); - if (outImage->isNull()) - return false; - } + if (!QImageIOHandler::allocateImage(QSize(w, h), format, outImage)) + return false; pbm_bpl = (qsizetype(w) * nbits + 7) / 8; // bytes per scanline in PBM |