path: root/src/gui/image/qplatformpixmap.cpp
diff options
authorHolger Hans Peter Freyther <>2012-01-23 14:02:48 +0100
committerQt by Nokia <>2012-02-02 01:56:03 +0100
commit9cbbd38f22fe0aff72599583c7702f88195a7607 (patch)
treec7d204eea7e72fd5caa80a580a1113c516e66fb9 /src/gui/image/qplatformpixmap.cpp
parentbd8ef8d073201504a983249c4006c827befacf09 (diff)
pixmap: Add QPlatformPixmap::fromData null check for the image
QPlatformPixmap::fromFile is doing the null check, QRasterPlatformPixmap::fromData is doing the null check as well. Add the null check to QPlatformPixmap::fromData as well. This would have avoided a crash in the directfb plugin. Change-Id: Ifc904b2df2424e86bf0992d4e28dc256530be02d Reviewed-by: Samuel Rødal <>
Diffstat (limited to 'src/gui/image/qplatformpixmap.cpp')
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/image/qplatformpixmap.cpp b/src/gui/image/qplatformpixmap.cpp
index c34b779797..5162ea80d9 100644
--- a/src/gui/image/qplatformpixmap.cpp
+++ b/src/gui/image/qplatformpixmap.cpp
@@ -133,6 +133,8 @@ bool QPlatformPixmap::fromData(const uchar *buf, uint len, const char *format, Q
QBuffer b(&a);;
QImage image = QImageReader(&b, format).read();
+ if (image.isNull())
+ return false;
fromImage(makeBitmapCompliantIfNeeded(this, image, flags), flags);
return !isNull();