summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qimage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/image/qimage.cpp')
-rw-r--r--src/gui/image/qimage.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 4f5efa1..5d2b4c0 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -5667,7 +5667,11 @@ void QImage::setAlphaChannel(const QImage &alphaChannel)
detach();
- *this = convertToFormat(QImage::Format_ARGB32_Premultiplied);
+ QImage converted = convertToFormat(QImage::Format_ARGB32_Premultiplied);
+ if (!converted.isNull())
+ *this = converted;
+ else
+ return;
// Slight optimization since alphachannels are returned as 8-bit grays.
if (alphaChannel.d->depth == 8 && alphaChannel.isGrayscale()) {