From 0d994523394c74911b32f29036b5bc13d9f5122f Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 17 Aug 2016 12:42:19 +0200 Subject: Protect QImage::convertToFormat against null QImage QImage may have a null d-pointer, and convertToFormat_helper was the only method not protected against it. Change-Id: Ibfe5b139e3922f2a0c8284c6ae1932c2150efc66 Reviewed-by: Marc Mutz --- src/gui/image/qimage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index ee77a32b86..17d3c02e36 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -2117,7 +2117,7 @@ static QImage convertWithPalette(const QImage &src, QImage::Format format, */ QImage QImage::convertToFormat(Format format, const QVector &colorTable, Qt::ImageConversionFlags flags) const { - if (d->format == format) + if (!d || d->format == format) return *this; if (format <= QImage::Format_Indexed8 && depth() == 32) { -- cgit v1.2.3