From 944a4065e8c21a082d1eb826e243f9d813ed8876 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Thu, 29 Jun 2017 13:54:48 -0500 Subject: [PATCH] gl_drm: Check dmabuf attribute version before trusting attributes We shouldn't do anything with a dmabuf structure until confirming the version matches the one we know. --- src/modules/evas/engines/gl_drm/evas_engine.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/evas/engines/gl_drm/evas_engine.c b/src/modules/evas/engines/gl_drm/evas_engine.c index fe69ef0dcc..44134464e8 100644 --- a/src/modules/evas/engines/gl_drm/evas_engine.c +++ b/src/modules/evas/engines/gl_drm/evas_engine.c @@ -1197,10 +1197,11 @@ eng_image_native_set(void *engine, void *image, void *native) if (!ns->data.wl_dmabuf.resource) { struct dmabuf_attributes *attr; - void *v; + void *v = NULL; attr = ns->data.wl_dmabuf.attr; - v = gl_import_simple_dmabuf(ob->egl.disp, attr); + if (attr->version == EVAS_DMABUF_ATTRIBUTE_VERSION) + v = gl_import_simple_dmabuf(ob->egl.disp, attr); if (!v) { ns->data.wl_dmabuf.attr = NULL; return NULL;