diff options
author | Trond Kjernåsen <trond@trolltech.com> | 2009-06-10 09:14:45 (GMT) |
---|---|---|
committer | Trond Kjernåsen <trond@trolltech.com> | 2009-06-10 09:50:59 (GMT) |
commit | d0823a0113253cf52859e84f41db82e96b80331e (patch) | |
tree | fd7d6b15c49cb03cb4f370b8b874c21e2c3975cd /src | |
parent | 7886888d3e873500dd1ea7d3f450f7d7f87c0ea6 (diff) | |
download | Qt-d0823a0113253cf52859e84f41db82e96b80331e.zip Qt-d0823a0113253cf52859e84f41db82e96b80331e.tar.gz Qt-d0823a0113253cf52859e84f41db82e96b80331e.tar.bz2 |
Make sure QImage::mirrored() doesn't crash if it runs out of memory.
Task-number: 255742
Reviewed-by: Kim
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/image/qimage.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 70d4e2c..338ae77 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -4277,6 +4277,11 @@ QImage QImage::mirrored(bool horizontal, bool vertical) const int h = d->height; // Create result image, copy colormap QImage result(d->width, d->height, d->format); + + // check if we ran out of of memory.. + if (!result.d) + return QImage(); + result.d->colortable = d->colortable; result.d->has_alpha_clut = d->has_alpha_clut; |