summaryrefslogtreecommitdiffstats
path: root/src/gui/image
diff options
context:
space:
mode:
authorJohannes Zellner <johannes.zellner@nokia.com>2010-04-12 11:46:00 (GMT)
committerJohannes Zellner <johannes.zellner@nokia.com>2010-04-12 11:46:00 (GMT)
commit059884feccfda94a16a7939b3394250723ed7c07 (patch)
tree24dd1c90737fd501605cc123ec381ac42d70beb8 /src/gui/image
parent2f1e7ef93b7faaedf55fddbad280e4aada9bfb9d (diff)
downloadQt-059884feccfda94a16a7939b3394250723ed7c07.zip
Qt-059884feccfda94a16a7939b3394250723ed7c07.tar.gz
Qt-059884feccfda94a16a7939b3394250723ed7c07.tar.bz2
Fix segfault, if QPixmap::loadFromData() fails
Reviewed-by: Harald Fernengel
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qpixmap_x11.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp
index e1e8a0d..f6905d7 100644
--- a/src/gui/image/qpixmap_x11.cpp
+++ b/src/gui/image/qpixmap_x11.cpp
@@ -383,7 +383,7 @@ struct QX11AlphaDetector
return has;
// Will implicitly also check format and return quickly for opaque types...
checked = true;
- has = const_cast<QImage *>(image)->data_ptr()->checkForAlphaPixels();
+ has = image->isNull() ? false : const_cast<QImage *>(image)->data_ptr()->checkForAlphaPixels();
return has;
}