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.
This commit is contained in:
Derek Foreman 2017-06-29 13:54:48 -05:00
parent 2e0e017b87
commit 944a4065e8
1 changed files with 3 additions and 2 deletions

View File

@ -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;