devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=1438a980dd1e02cea0c9759d85372505bb1a9254
commit 1438a980dd1e02cea0c9759d85372505bb1a9254 Author: Chris Michael <cp.mich...@samsung.com> Date: Sun Apr 12 21:08:20 2015 -0400 evas-software-x11: Fix dereference before null check(s) Summary: This fixes Coverity CID1270028, CID1270029, CID1270030 where variables RGBA_Image and Native where dereferencing function input paramaters Before null checking them. @fix Signed-off-by: Chris Michael <cp.mich...@samsung.com> --- .../evas/engines/software_x11/evas_native_tbm.c | 25 ++++++++++++++-------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/modules/evas/engines/software_x11/evas_native_tbm.c b/src/modules/evas/engines/software_x11/evas_native_tbm.c index 85b3fc7..aeedc70 100644 --- a/src/modules/evas/engines/software_x11/evas_native_tbm.c +++ b/src/modules/evas/engines/software_x11/evas_native_tbm.c @@ -214,10 +214,12 @@ _evas_video_nv12(unsigned char *evas_data, const unsigned char *source_data, uns static void _native_bind_cb(void *data EINA_UNUSED, void *image, int x EINA_UNUSED, int y EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED) { - RGBA_Image *im = image; - Native *n = im->native.data; + RGBA_Image *im; + Native *n; + + if (!(im = image)) return; - if (!im) return; + n = im->native.data; if ((n) && (n->ns.type == EVAS_NATIVE_SURFACE_TBM)) { tbm_surface_info_s info; @@ -231,10 +233,12 @@ _native_bind_cb(void *data EINA_UNUSED, void *image, int x EINA_UNUSED, int y EI static void _native_unbind_cb(void *data EINA_UNUSED, void *image) { - RGBA_Image *im = image; - Native *n = im->native.data; + RGBA_Image *im; + Native *n; + + if (!(im = image)) return; - if (!im) return; + n = im->native.data; if ((n) && (n->ns.type == EVAS_NATIVE_SURFACE_TBM)) { sym_tbm_surface_unmap(n->ns.data.tbm.buffer); @@ -244,10 +248,13 @@ _native_unbind_cb(void *data EINA_UNUSED, void *image) static void _native_free_cb(void *data EINA_UNUSED, void *image) { - RGBA_Image *im = image; - Native *n = im->native.data; + RGBA_Image *im; + Native *n; + + if (!(im = image)) return; + + n = im->native.data; - if (!im) return; im->native.data = NULL; im->native.func.bind = NULL; im->native.func.unbind = NULL; --