From: Rob Bradford <[email protected]>

gbm_bo_import will fail to produce a valid bo since the buffer is an SHM
buffer. This cause a crash when the NULL bo returned by gbm_bo_import is
dereferenced later.

Signed-off-by: Rob Bradford <[email protected]>
---
 src/compositor-drm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 0faf45c..10f16bd 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -289,6 +289,9 @@ drm_output_prepare_scanout_surface(struct weston_output 
*_output,
            es->buffer == NULL)
                return NULL;
 
+       if (wl_buffer_is_shm(es->buffer))
+               return NULL;
+
        bo = gbm_bo_import(c->gbm, GBM_BO_IMPORT_WL_BUFFER,
                           es->buffer, GBM_BO_USE_SCANOUT);
 
-- 
1.7.11.2

_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to