summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@viroteck.net>2014-08-17 14:44:32 +0200
committerRobin Burchell <robin.burchell@viroteck.net>2014-08-18 13:52:24 +0200
commit8ed1e393994faeaf8d60d37cddba31738d9de779 (patch)
tree067f7c3882c9a81a926228bc8f6f95fe4c72c2ef
parenta1020bdc179c671da510ddc4b92fed66bf9b5c33 (diff)
downloadqtwayland-8ed1e393994faeaf8d60d37cddba31738d9de779.tar.gz
qwindow-compositor: Fix null pointer dereference.
setCursorSurface may be invoked with a null surface. This was exposed by tst_QWidget::destroyBackingStore. Change-Id: Iac1ef6d2f17e5ee6a693ddbf3875b743bde2ded1 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
-rw-r--r--examples/qwindow-compositor/qwindowcompositor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/qwindow-compositor/qwindowcompositor.cpp b/examples/qwindow-compositor/qwindowcompositor.cpp
index 712beafa..95541aef 100644
--- a/examples/qwindow-compositor/qwindowcompositor.cpp
+++ b/examples/qwindow-compositor/qwindowcompositor.cpp
@@ -279,7 +279,7 @@ void QWindowCompositor::setCursorSurface(QWaylandSurface *surface, int hotspotX,
m_cursorSurface = surface;
m_cursorHotspotX = hotspotX;
m_cursorHotspotY = hotspotY;
- if (!m_cursorSurface->bufferAttacher())
+ if (m_cursorSurface && !m_cursorSurface->bufferAttacher())
m_cursorSurface->setBufferAttacher(new BufferAttacher);
}