evas-software-x11: Fix returning NULL pointer
authorChris Michael <cp.michael@samsung.com>
Tue, 17 Nov 2015 14:07:45 +0000 (09:07 -0500)
committerChris Michael <cp.michael@samsung.com>
Tue, 17 Nov 2015 14:07:45 +0000 (09:07 -0500)
evas_xlib_image_dri_native_set should be returning a pointer to an
RGBA_Image on success, or NULL on failure. Returning EINA_FALSE here
leads to an expression which evaluates to zero being treated as a null
pointer constant

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/modules/evas/engines/software_x11/evas_xlib_dri_image.c

index 527f1f9..2c1c72c 100644 (file)
@@ -564,12 +564,12 @@ evas_xlib_image_dri_native_set(void *data, void *image, void *native)
    unsigned int uidum, depth = 0;
 
    if (!ns || ns->type != EVAS_NATIVE_SURFACE_X11)
-     return EINA_FALSE;
+     return NULL;
 
    d = ob->priv.x11.xlib.disp;
    vis = ns->data.x11.visual;
    pm = ns->data.x11.pixmap;
-   if (!pm) return EINA_FALSE;
+   if (!pm) return NULL;
 
    XGetGeometry(d, pm, &wdum, &idum, &idum, &uidum, &uidum, &uidum, &depth);
 
@@ -581,14 +581,14 @@ evas_xlib_image_dri_native_set(void *data, void *image, void *native)
    if (!exim)
      {
         ERR("evas_xlib_image_dri_new failed.");
-        return EINA_FALSE;
+        return NULL;
      }
 
    exim->draw = (Drawable)ns->data.x11.pixmap;
 
    n = calloc(1, sizeof(DRI_Native));
    if (!n)
-     return EINA_FALSE;
+     return NULL;
 
    memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface));
    n->pixmap = pm;
@@ -601,7 +601,7 @@ evas_xlib_image_dri_native_set(void *data, void *image, void *native)
    im->native.func.free = _native_free_cb;
 
    if (evas_xlib_image_dri_init(exim, d)) evas_xlib_image_get_buffers(im);
-   else return EINA_FALSE;
+   else return NULL;
    return im;
 }