summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Loew <andreas@code-and-web.de>2012-03-09 13:28:14 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-04-13 02:23:46 (GMT)
commitfbe9f5b96c36b872aa02049d7bda7c4cebfd8edd (patch)
treecce0dce45519225bee1ab3d70b4db63d0480c397 /src
parent7ac8d8597db1f58b11338f91fb27f6ad8696b34b (diff)
downloadQt-fbe9f5b96c36b872aa02049d7bda7c4cebfd8edd.zip
Qt-fbe9f5b96c36b872aa02049d7bda7c4cebfd8edd.tar.gz
Qt-fbe9f5b96c36b872aa02049d7bda7c4cebfd8edd.tar.bz2
Fixed crash in QImage in out of memory condition
Change-Id: I64467525d3365903e83b2e7e9cf381dd5a39c2b4 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Diffstat (limited to 'src')
-rw-r--r--src/gui/image/qimage.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 1f1052f..6d59eaa 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -4202,6 +4202,10 @@ void QImage::setPixel(int x, int y, uint index_or_rgb)
}
// detach is called from within scanLine
uchar * s = scanLine(y);
+ if (!s) {
+ qWarning("setPixel: Out of memory");
+ return;
+ }
const quint32p p = quint32p::fromRawData(index_or_rgb);
switch(d->format) {
case Format_Mono: