summaryrefslogtreecommitdiffstats
path: root/src/gui/image
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-11-04 11:05:46 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-11-04 11:05:46 (GMT)
commitdfceed4535110d345b89658729b66bbdb2c3d7ca (patch)
treecb6cb7bb3b3e6a500394ca22f4768ce054583a8a /src/gui/image
parent1400ce5b85fbe7c67899f5f62bfd276eecb21ae0 (diff)
downloadQt-dfceed4535110d345b89658729b66bbdb2c3d7ca.zip
Qt-dfceed4535110d345b89658729b66bbdb2c3d7ca.tar.gz
Qt-dfceed4535110d345b89658729b66bbdb2c3d7ca.tar.bz2
Fixed crash when QImage::createAlphaMask() runs out of memory
Reviewed-by: Trond
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qimage.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 571ef9d..21ca1e3 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -4083,7 +4083,8 @@ QImage QImage::createAlphaMask(Qt::ImageConversionFlags flags) const
}
QImage mask(d->width, d->height, Format_MonoLSB);
- dither_to_Mono(mask.d, d, flags, true);
+ if (!mask.isNull())
+ dither_to_Mono(mask.d, d, flags, true);
return mask;
}