summaryrefslogtreecommitdiffstats
path: root/src/plugins/imageformats/jpeg/qjpeghandler.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/plugins/imageformats/jpeg/qjpeghandler.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/plugins/imageformats/jpeg/qjpeghandler.cpp')
-rw-r--r--src/plugins/imageformats/jpeg/qjpeghandler.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
index 25b0c625fd..1b48e8fc90 100644
--- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp
+++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
@@ -240,10 +240,7 @@ static bool ensureValidImage(QImage *dest, struct jpeg_decompress_struct *info,
return false; // unsupported format
}
- if (dest->size() != size || dest->format() != format)
- *dest = QImage(size, format);
-
- return !dest->isNull();
+ return QImageIOHandler::allocateImage(size, format, dest);
}
static bool read_jpeg_image(QImage *outImage,