e_pixmap: checking if ec->comp_data is valid 40/129640/1 accepted/tizen/unified/20170517.125612 submit/tizen/20170517.050332 tizen_4.0.m1_release
authorBoram Park <boram1288.park@samsung.com>
Wed, 17 May 2017 08:32:59 +0000 (17:32 +0900)
committerBoram Park <boram1288.park@samsung.com>
Wed, 17 May 2017 08:34:09 +0000 (17:34 +0900)
Change-Id: I54f5ffa19adce8e0c013b787b85b35ceeeaac0a4

src/bin/e_pixmap.c

index 5930c442aebc7e70bd47353c62e5e487920851ff..aec0236ea9129afaee143b0d902ffd27e056a64c 100644 (file)
@@ -501,7 +501,11 @@ e_pixmap_size_changed(E_Pixmap *cp, int w, int h)
    EINA_SAFETY_ON_NULL_RETURN_VAL(cp, EINA_FALSE);
    EINA_SAFETY_ON_NULL_RETURN_VAL(cp->client, EINA_FALSE);
    if (cp->dirty) return EINA_TRUE;
+
    ec = cp->client;
+   if (!ec->comp_data || e_object_is_del(E_OBJECT(ec)))
+     return (w != cp->w) || (h != cp->h);
+
    return (w != ec->comp_data->width_from_buffer) || (h != ec->comp_data->height_from_buffer);
 }
 
@@ -513,7 +517,15 @@ e_pixmap_size_get(E_Pixmap *cp, int *w, int *h)
    if (h) *h = 0;
    EINA_SAFETY_ON_NULL_RETURN_VAL(cp, EINA_FALSE);
    EINA_SAFETY_ON_NULL_RETURN_VAL(cp->client, EINA_FALSE);
+
    ec = cp->client;
+   if (!ec->comp_data || e_object_is_del(E_OBJECT(ec)))
+     {
+        if (w) *w = cp->w;
+        if (h) *h = cp->h;
+        return (cp->w > 0) && (cp->h > 0);
+     }
+
    if (w) *w = ec->comp_data->width_from_buffer;
    if (h) *h = ec->comp_data->height_from_buffer;
    return (ec->comp_data->width_from_buffer > 0) && (ec->comp_data->height_from_buffer > 0);