summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPauli Nieminen <ext-pauli.nieminen@nokia.com>2011-04-01 06:31:15 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2011-04-01 06:31:15 (GMT)
commit7d9ea423e426aa2809e8848856449c7ba8924458 (patch)
tree3515fd773b5d4f0308189b2441d1153f2dd44ebc
parent094fbf3e4af48964089cbe30a71d5f38a54a8e51 (diff)
downloadQt-7d9ea423e426aa2809e8848856449c7ba8924458.zip
Qt-7d9ea423e426aa2809e8848856449c7ba8924458.tar.gz
Qt-7d9ea423e426aa2809e8848856449c7ba8924458.tar.bz2
Check that pixmap is not null before accessing it
If QMeeGoGraphicsSystem::createPixmapData is called with origin raster pixmap data holding null image would result to null pointer deference when trying to fetch data pointer. To avoid the crash at graphics system switch pixmap data should be checked if it is NULL. Fixes: NB#237972 Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Merge-request: 1160 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
-rw-r--r--src/plugins/graphicssystems/meego/qmeegographicssystem.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
index c904c3c..c515f55 100644
--- a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
+++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
@@ -217,7 +217,7 @@ QPixmapData *QMeeGoGraphicsSystem::createPixmapData(QPixmapData *origin)
// and if the pixmap pointer matches our mapping...
// create a shared image instead with the given handle.
- if (origin->classId() == QPixmapData::RasterClass) {
+ if (!origin->isNull() && origin->classId() == QPixmapData::RasterClass) {
QRasterPixmapData *rasterClass = static_cast <QRasterPixmapData *> (origin);
void *rawResource = static_cast <void *> (rasterClass->buffer()->data_ptr()->data);