summaryrefslogtreecommitdiffstats
path: root/src/compositor/wayland_wrapper
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@theqtcompany.com>2015-09-16 14:02:47 +0200
committerJørgen Lind <jorgen.lind@theqtcompany.com>2015-09-16 12:28:21 +0000
commit0bfb35367d3eec75b4d67152b68a7f9f45cc9854 (patch)
tree8ea886a30ad8cb791768bf2832f64a93278c5b30 /src/compositor/wayland_wrapper
parentbb46fc4cd6ad89346597bb03882f2c6f3525faa3 (diff)
Return empty size when nil buffer is attached
Change-Id: I74d46c9d2639315341a1e101e304cdffd748976c Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Diffstat (limited to 'src/compositor/wayland_wrapper')
-rw-r--r--src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp
index dadc53b99..ae0451592 100644
--- a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp
+++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp
@@ -155,6 +155,9 @@ void SurfaceBuffer::destroyIfUnused()
QSize SurfaceBuffer::size() const
{
+ if (!m_buffer)
+ return QSize();
+
if (wl_shm_buffer *shmBuffer = wl_shm_buffer_get(m_buffer)) {
int width = wl_shm_buffer_get_width(shmBuffer);
int height = wl_shm_buffer_get_height(shmBuffer);