diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-08-17 12:42:19 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-08-17 12:54:05 +0000 |
commit | 0d994523394c74911b32f29036b5bc13d9f5122f (patch) | |
tree | cf5fdc98572335a05236fa8618ee6b1df2fec4f8 /src/gui | |
parent | 2b0e52757c9dedd95ca676e72c7d00adcdffc3dd (diff) |
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 <marc.mutz@kdab.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/image/qimage.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<QRgb> &colorTable, Qt::ImageConversionFlags flags) const { - if (d->format == format) + if (!d || d->format == format) return *this; if (format <= QImage::Format_Indexed8 && depth() == 32) { |