gbm: Reject buffers that are not wl_drm buffers in gbm_bo_import()
authorKristian Høgsberg <krh@bitplanet.net>
Mon, 1 Oct 2012 15:19:10 +0000 (11:19 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 16 Oct 2012 02:33:04 +0000 (22:33 -0400)
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
src/gbm/backends/dri/gbm_dri.c

index d8b1cc78892c684fe2e30b4f647265d99489d206..70ea668c09f2c943a518d12cb85da68074c0227a 100644 (file)
@@ -375,6 +375,9 @@ gbm_dri_bo_import(struct gbm_device *gbm,
    {
       struct wl_drm_buffer *wb = (struct wl_drm_buffer *) buffer;
 
+      if (!wayland_buffer_is_drm(buffer))
+         return NULL;
+
       image = wb->driver_buffer;
 
       switch (wb->format) {