Fixed memory leak and invalid memory access 60/78460/2
authorMinJeong Kim <minjjj.kim@samsung.com>
Tue, 5 Jul 2016 13:15:14 +0000 (22:15 +0900)
committerMinJeong Kim <minjjj.kim@samsung.com>
Wed, 6 Jul 2016 06:27:37 +0000 (15:27 +0900)
Change-Id: I6a0fa8f1f56296e199ad386c32a53df23e2b3205

src/e_mod_effect.c
src/e_mod_effect_rotation.c

index c4dffdd..8c969a9 100644 (file)
@@ -175,8 +175,8 @@ _e_mod_effect_unref(E_Client *ec)
         e_pixmap_free(efc->ep);
         if (!e_object_unref(E_OBJECT(ec)))
           {
-             EFFINF("Effect unref efc(%p) Client free'd",
-                    efc->ep, ec, efc);
+             EFFINF("Effect unref ec(%p) ep(%p) efc(%p) Client free'd",
+                    NULL, NULL, ec, efc->ep, efc);
 
              efc->ec = NULL;
              efc = NULL;
index 8a127e8..5fa3a0b 100644 (file)
@@ -115,14 +115,14 @@ _rotation_effect_targets_get(Rotation_Effect *effect)
 
    if (!effect) return NULL;
 
+   if (effect->zone->display_state == E_ZONE_DISPLAY_STATE_OFF)
+     return NULL;
+
    x = y = w = h = 0;
 
    t = eina_tiler_new(effect->zone->w + edge, effect->zone->h + edge);
    eina_tiler_tile_size_set(t, 1, 1);
 
-   if (effect->zone->display_state == E_ZONE_DISPLAY_STATE_OFF)
-     return NULL;
-
    EINA_RECTANGLE_SET(&r, effect->zone->x, effect->zone->y, effect->zone->w, effect->zone->h);
    eina_tiler_rect_add(t, &r);
 
@@ -147,6 +147,7 @@ _rotation_effect_targets_get(Rotation_Effect *effect)
                  (ec->e.state.rot.ang.curr == effect->zone->rot.curr))
                {
                   if (l) eina_list_free(l);
+                  eina_tiler_free(t);
                   return NULL;
                }
           }
@@ -161,6 +162,7 @@ _rotation_effect_targets_get(Rotation_Effect *effect)
 
         if (eina_tiler_empty(t)) break;
      }
+   eina_tiler_free(t);
 
    return l;
 }
@@ -218,7 +220,9 @@ _rotation_effect_object_create(Evas_Object *o)
 
              w = buffer->w;
              h = buffer->h;
+
              pix = wl_shm_buffer_get_data(buffer->shm_buffer);
+             if (!pix) goto fail;
 
              if (eobj->data_pool)
                wl_shm_pool_unref(eobj->data_pool);
@@ -232,6 +236,8 @@ _rotation_effect_object_create(Evas_Object *o)
              tbm_surface_map(tbm_surface, TBM_SURF_OPTION_READ, &surface_info);
 
              data = surface_info.planes[0].ptr;
+             if (!data) goto fail;
+
              w = surface_info.width;
              h = surface_info.height;
 
@@ -255,6 +261,8 @@ _rotation_effect_object_create(Evas_Object *o)
              tbm_surface_map(tbm_surface, TBM_SURF_OPTION_READ, &surface_info);
 
              data = surface_info.planes[0].ptr;
+             if (!data) goto fail;
+
              w = surface_info.width;
              h = surface_info.height;