summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoungbok Shin <youngb.shin@samsung.com>2015-06-17 15:09:13 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-06-17 15:59:19 +0200
commitb52cbe891530f3e2e02ca1a2ff0a805380b017fd (patch)
tree61386c01e143fa1fc6b9ca2569c2bc0c16fe0e38
parent8bd3e79bb1805f71e13cdca5fbf1850f6ba5d6c7 (diff)
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 <cedric@osg.samsung.com>
-rw-r--r--src/lib/elm_colorselector.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/elm_colorselector.c b/src/lib/elm_colorselector.c
index 3d99d63c1..78bcb9336 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)
620 scr = ecore_x_default_screen_get(); 620 scr = ecore_x_default_screen_get();
621 visual = ecore_x_default_visual_get(display, scr); 621 visual = ecore_x_default_visual_get(display, scr);
622 img = ecore_x_image_new(17, 17, visual, ecore_x_window_depth_get(sd->grab.xroot)); 622 img = ecore_x_image_new(17, 17, visual, ecore_x_window_depth_get(sd->grab.xroot));
623
624 if (!img)
625 {
626 ERR("Failed to get an image from ecore_x_image_new()");
627 return EINA_TRUE;
628 }
629
623 ecore_x_image_get(img, sd->grab.xroot, x - 8, y - 8, 0, 0, 17, 17); 630 ecore_x_image_get(img, sd->grab.xroot, x - 8, y - 8, 0, 0, 17, 17);
624 src = ecore_x_image_data_get(img, &bpl, &rows, &bpp); 631 src = ecore_x_image_data_get(img, &bpl, &rows, &bpp);
625 if (!ecore_x_image_is_argb32_get(img)) 632 if (!ecore_x_image_is_argb32_get(img))