evas: native_dmabuf: make sure we check for NULL before not after we dereference

Same change as  just done in evas_native_tbm in commit
38dbe932db5c12f66ff2e045ac74107e149c14da.
This commit is contained in:
Stefan Schmidt 2016-12-06 10:49:10 +01:00
parent 7d93a1d45f
commit 10fb982ac0
1 changed files with 7 additions and 5 deletions

View File

@ -19,9 +19,10 @@ _native_bind_cb(void *image, int x EINA_UNUSED, int y EINA_UNUSED, int w EINA_UN
struct dmabuf_attributes *a;
int size;
RGBA_Image *im = image;
Native *n = im->native.data;
if (!im || !n) return;
if (!im) return;
Native *n = im->native.data;
if (!n) return;
if (n->ns.type != EVAS_NATIVE_SURFACE_WL_DMABUF)
return;
@ -44,9 +45,10 @@ static void
_native_unbind_cb(void *image)
{
RGBA_Image *im = image;
Native *n = im->native.data;
if (!im || !n) return;
if (!im) return;
Native *n = im->native.data;
if (!n) return;
if (n->ns.type != EVAS_NATIVE_SURFACE_WL_DMABUF)
return;
}
@ -55,9 +57,9 @@ static void
_native_free_cb(void *image)
{
RGBA_Image *im = image;
Native *n = im->native.data;
if (!im) return;
Native *n = im->native.data;
if (im->image.data)
munmap(n->ns_data.wl_surface_dmabuf.ptr,