[clutter] grid-layout: Don't use uninitialized values



commit 039ba910f00d92c51d04babc2a7ca345fc380f2d
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Nov 30 21:07:49 2012 -0500

    grid-layout: Don't use uninitialized values
    
    The clutter_actor_box_set_* methods rely on the current box
    geometry, so we can't use those for an uninitialize actor box.
    Found by Coverity.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=689496

 clutter/clutter-grid-layout.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/clutter/clutter-grid-layout.c b/clutter/clutter-grid-layout.c
index f56774d..8c419bb 100644
--- a/clutter/clutter-grid-layout.c
+++ b/clutter/clutter-grid-layout.c
@@ -1425,13 +1425,16 @@ clutter_grid_layout_allocate (ClutterLayoutManager   *layout,
                       &y, &height);
       x += allocation->x1;
       y += allocation->y1;
-      clutter_actor_box_set_origin (&child_allocation, x, y);
-      clutter_actor_box_set_size (&child_allocation, width, height);
 
       CLUTTER_NOTE (LAYOUT, "Allocation for %s { %.2f, %.2f - %.2f x %.2f }",
                     _clutter_actor_get_debug_name (child),
                     x, y, width, height);
 
+      child_allocation.x1 = x;
+      child_allocation.y1 = y;
+      child_allocation.x2 = child_allocation.x1 + width;
+      child_allocation.y2 = child_allocation.y1 + height;
+
       clutter_actor_allocate (child, &child_allocation, flags);
     }
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]