summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarkus Goetz <Markus.Goetz@nokia.com>2009-10-26 12:58:03 (GMT)
committerMarkus Goetz <Markus.Goetz@nokia.com>2009-10-26 13:19:41 (GMT)
commit96b18246c4930332cadc80f97202e44110e22a4d (patch)
treee88f1fa479fa77de5eac30a68d6121e2e9ade4b6 /src
parente2ef97128c006ac2a5c99c67bb54eebaa3b45720 (diff)
downloadQt-96b18246c4930332cadc80f97202e44110e22a4d.zip
Qt-96b18246c4930332cadc80f97202e44110e22a4d.tar.gz
Qt-96b18246c4930332cadc80f97202e44110e22a4d.tar.bz2
QPixmap::loadFromData: Do not crash on empty/invalid data/length
Task-number: 262636 Reviewed-by: gunnar
Diffstat (limited to 'src')
-rw-r--r--src/gui/image/qpixmap.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index a3b7516..45ff5f4 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -860,6 +860,9 @@ bool QPixmap::load(const QString &fileName, const char *format, Qt::ImageConvers
bool QPixmap::loadFromData(const uchar *buf, uint len, const char *format, Qt::ImageConversionFlags flags)
{
+ if (len == 0 || buf == 0)
+ return false;
+
return data->fromData(buf, len, format, flags);
}