diff options
author | Youngbok Shin <youngb.shin@samsung.com> | 2015-06-17 15:09:13 +0200 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2015-06-17 15:59:19 +0200 |
commit | b52cbe891530f3e2e02ca1a2ff0a805380b017fd (patch) | |
tree | 61386c01e143fa1fc6b9ca2569c2bc0c16fe0e38 | |
parent | 8bd3e79bb1805f71e13cdca5fbf1850f6ba5d6c7 (diff) | |
download | elementary-b52cbe891530f3e2e02ca1a2ff0a805380b017fd.tar.gz |
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.c | 7 |
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) 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)) |