rotation: fix OVERRUN issue for svace. 28/216128/1
authorSeunghun Lee <shiin.lee@samsung.com>
Mon, 21 Oct 2019 08:16:33 +0000 (17:16 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Mon, 21 Oct 2019 08:35:23 +0000 (17:35 +0900)
Added escape condition in case that both value of 'x' and
e_comp_canvas_layer_map() is 0.

Change-Id: I386e253f19243dd7c23b2aa0a9291ea4febd1021

src/rotation/e_mod_rotation_wl.c

index f829eaf..4cf6fb4 100644 (file)
@@ -1568,16 +1568,21 @@ e_client_rotation_find_below(const E_Client *ec)
 
    for (; x >= e_comp_canvas_layer_map(E_LAYER_CLIENT_DESKTOP); x--)
      {
-        if (!e_comp->layers[x].clients) continue;
-        EINA_INLIST_REVERSE_FOREACH(e_comp->layers[x].clients, ec2)
+        if (e_comp->layers[x].clients)
           {
-             if (ec2 == ec) continue;
-             if ((ec2->comp_data && ec2->comp_data->mapped) &&
-                 (!e_object_is_del(E_OBJECT(ec2))) &&
-                 (!e_client_util_ignored_get(ec2)) &&
-                 (!ec2->exp_iconify.by_client))
-               return ec2;
+             EINA_INLIST_REVERSE_FOREACH(e_comp->layers[x].clients, ec2)
+               {
+                  if (ec2 == ec) continue;
+                  if ((ec2->comp_data && ec2->comp_data->mapped) &&
+                      (!e_object_is_del(E_OBJECT(ec2))) &&
+                      (!e_client_util_ignored_get(ec2)) &&
+                      (!ec2->exp_iconify.by_client))
+                    return ec2;
+               }
           }
+
+        if (x == 0)
+          break;
      }
    return NULL;
 }