diff options
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qimage.cpp | 3 | ||||
-rw-r--r-- | src/gui/image/qimagewriter.cpp | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index ce1d6d3..d226baf 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -5709,6 +5709,9 @@ void QImage::setAlphaChannel(const QImage &alphaChannel) else *this = convertToFormat(QImage::Format_ARGB32_Premultiplied); + if (isNull()) + return; + // Slight optimization since alphachannels are returned as 8-bit grays. if (alphaChannel.d->depth == 8 && alphaChannel.isGrayscale()) { const uchar *src_data = alphaChannel.d->data; diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp index a5f7b31..503a1b2 100644 --- a/src/gui/image/qimagewriter.cpp +++ b/src/gui/image/qimagewriter.cpp @@ -197,6 +197,7 @@ static QImageIOHandler *createWriteHandlerHelper(QIODevice *device, for (int i = 0; i < keys.size(); ++i) { QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(keys.at(i))); if (plugin && (plugin->capabilities(device, testFormat) & QImageIOPlugin::CanWrite)) { + delete handler; handler = plugin->create(device, testFormat); break; } |