cedric pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=b52cbe891530f3e2e02ca1a2ff0a805380b017fd

commit b52cbe891530f3e2e02ca1a2ff0a805380b017fd
Author: Youngbok Shin <youngb.s...@samsung.com>
Date:   Wed Jun 17 15:09:13 2015 +0200

    colorselector: add safety check for NULL pointer from ecore_x_image_new().
    
    Summary:
    ecore_x_image_new() API can return NULL.
    @fix
    
    Reviewers: raster, woohyun, Hermet, cedric
    
    Differential Revision: https://phab.enlightenment.org/D2667
    
    Signed-off-by: Cedric BAIL <ced...@osg.samsung.com>
---
 src/lib/elm_colorselector.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/lib/elm_colorselector.c b/src/lib/elm_colorselector.c
index 3d99d63..78bcb93 100644
--- a/src/lib/elm_colorselector.c
+++ b/src/lib/elm_colorselector.c
@@ -620,6 +620,13 @@ _mouse_grab_pixels(void *data, int type EINA_UNUSED, void 
*event EINA_UNUSED)
    scr = ecore_x_default_screen_get();
    visual = ecore_x_default_visual_get(display, scr);
    img = ecore_x_image_new(17, 17, visual, 
ecore_x_window_depth_get(sd->grab.xroot));
+
+   if (!img)
+     {
+        ERR("Failed to get an image from ecore_x_image_new()");
+        return EINA_TRUE;
+     }
+
    ecore_x_image_get(img, sd->grab.xroot, x - 8, y - 8, 0, 0, 17, 17);
    src = ecore_x_image_data_get(img, &bpl, &rows, &bpp);
    if (!ecore_x_image_is_argb32_get(img))

-- 


Reply via email to