From 67baa8f84e72ccc1eff793989fbe33888a0438d1 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Fri, 14 Sep 2012 23:02:47 +0100 Subject: [PATCH] compositor-drm: Don't try and scan out a SHM buffer directly 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 --- src/compositor-drm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compositor-drm.c b/src/compositor-drm.c index f055118..127a6e5 100644 --- a/src/compositor-drm.c +++ b/src/compositor-drm.c @@ -316,6 +316,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); -- 2.7.4