stefan pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=10fb982ac01874fa273d67a91aa4e852485b86f1

commit 10fb982ac01874fa273d67a91aa4e852485b86f1
Author: Stefan Schmidt <ste...@osg.samsung.com>
Date:   Tue Dec 6 10:49:10 2016 +0100

    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.
---
 .../evas/engines/software_generic/evas_native_dmabuf.c       | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/modules/evas/engines/software_generic/evas_native_dmabuf.c 
b/src/modules/evas/engines/software_generic/evas_native_dmabuf.c
index e19db5b..d85e352 100644
--- a/src/modules/evas/engines/software_generic/evas_native_dmabuf.c
+++ b/src/modules/evas/engines/software_generic/evas_native_dmabuf.c
@@ -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,

-- 


Reply via email to