From: Sérgio Martins Date: Sun, 21 Oct 2012 23:55:04 +0000 (+0100) Subject: Don't crash if there's no m_image yet. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6e908f09dfc19be3cbbf38628c63c348c5172e53;p=profile%2Fivi%2Fqtbase.git Don't crash if there's no m_image yet. Reproducible with: QBackingStore store( &window ); store.beginPaint(QRect(0,0,500,500)); All other methods already have null pointer checks. Change-Id: Ie278a263760900b58cf4a2ef286deb7f35d50cd0 Reviewed-by: Samuel Rødal --- diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp index 847fd67..649469a 100644 --- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp +++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp @@ -262,11 +262,14 @@ QXcbBackingStore::~QXcbBackingStore() QPaintDevice *QXcbBackingStore::paintDevice() { - return m_image->image(); + return m_image ? m_image->image() : 0; } void QXcbBackingStore::beginPaint(const QRegion ®ion) { + if (!m_image) + return; + m_image->preparePaint(region); #if 0