summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-11-17 09:07:45 -0500
committerChris Michael <cp.michael@samsung.com>2015-11-17 09:07:45 -0500
commit59ffefb9c1aa187435341d75f5811971ab917b2d (patch)
tree700dbc75b3126a9a982cccbe0ed9b985b40b2f37
parent2f0349f697451626cdce5fa8a3f20aa5c618436e (diff)
evas-software-x11: Fix returning NULL pointer
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>
-rw-r--r--src/modules/evas/engines/software_x11/evas_xlib_dri_image.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/modules/evas/engines/software_x11/evas_xlib_dri_image.c b/src/modules/evas/engines/software_x11/evas_xlib_dri_image.c
index 527f1f927f..2c1c72c025 100644
--- a/src/modules/evas/engines/software_x11/evas_xlib_dri_image.c
+++ b/src/modules/evas/engines/software_x11/evas_xlib_dri_image.c
@@ -564,12 +564,12 @@ evas_xlib_image_dri_native_set(void *data, void *image, void *native)
564 unsigned int uidum, depth = 0; 564 unsigned int uidum, depth = 0;
565 565
566 if (!ns || ns->type != EVAS_NATIVE_SURFACE_X11) 566 if (!ns || ns->type != EVAS_NATIVE_SURFACE_X11)
567 return EINA_FALSE; 567 return NULL;
568 568
569 d = ob->priv.x11.xlib.disp; 569 d = ob->priv.x11.xlib.disp;
570 vis = ns->data.x11.visual; 570 vis = ns->data.x11.visual;
571 pm = ns->data.x11.pixmap; 571 pm = ns->data.x11.pixmap;
572 if (!pm) return EINA_FALSE; 572 if (!pm) return NULL;
573 573
574 XGetGeometry(d, pm, &wdum, &idum, &idum, &uidum, &uidum, &uidum, &depth); 574 XGetGeometry(d, pm, &wdum, &idum, &idum, &uidum, &uidum, &uidum, &depth);
575 575
@@ -581,14 +581,14 @@ evas_xlib_image_dri_native_set(void *data, void *image, void *native)
581 if (!exim) 581 if (!exim)
582 { 582 {
583 ERR("evas_xlib_image_dri_new failed."); 583 ERR("evas_xlib_image_dri_new failed.");
584 return EINA_FALSE; 584 return NULL;
585 } 585 }
586 586
587 exim->draw = (Drawable)ns->data.x11.pixmap; 587 exim->draw = (Drawable)ns->data.x11.pixmap;
588 588
589 n = calloc(1, sizeof(DRI_Native)); 589 n = calloc(1, sizeof(DRI_Native));
590 if (!n) 590 if (!n)
591 return EINA_FALSE; 591 return NULL;
592 592
593 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface)); 593 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface));
594 n->pixmap = pm; 594 n->pixmap = pm;
@@ -601,7 +601,7 @@ evas_xlib_image_dri_native_set(void *data, void *image, void *native)
601 im->native.func.free = _native_free_cb; 601 im->native.func.free = _native_free_cb;
602 602
603 if (evas_xlib_image_dri_init(exim, d)) evas_xlib_image_get_buffers(im); 603 if (evas_xlib_image_dri_init(exim, d)) evas_xlib_image_get_buffers(im);
604 else return EINA_FALSE; 604 else return NULL;
605 return im; 605 return im;
606} 606}
607 607