Skip to content

Commit

Permalink
QImageIO: use the new allocation checker in the format handlers
Browse files Browse the repository at this point in the history
Change-Id: I604d99ce476d4758a1e20b78257082911f1f1546
Task-number: QTBUG-85037
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
  • Loading branch information
aavit committed Jun 26, 2020
1 parent 5dea4fe commit 1a63409

File 3 of 8 in 1a63409

7 changes: 2 additions & 5 deletions src/gui/image/qppmhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading

0 comments on commit 1a63409

Please sign in to comment.