From 7d9ea423e426aa2809e8848856449c7ba8924458 Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Fri, 1 Apr 2011 08:31:15 +0200 Subject: Check that pixmap is not null before accessing it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Merge-request: 1160 Reviewed-by: Jørgen Lind --- src/plugins/graphicssystems/meego/qmeegographicssystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 (origin); void *rawResource = static_cast (rasterClass->buffer()->data_ptr()->data); -- cgit v0.12