derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=944a4065e8c21a082d1eb826e243f9d813ed8876

commit 944a4065e8c21a082d1eb826e243f9d813ed8876
Author: Derek Foreman <der...@osg.samsung.com>
Date:   Thu Jun 29 13:54:48 2017 -0500

    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;

-- 


Reply via email to