diff options
author | Mike Ruprecht <mike.ruprecht@collabora.co.uk> | 2012-05-22 14:25:19 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@linux.intel.com> | 2012-05-25 15:13:05 +0100 |
commit | eb811210e25a2bcc7b9fa8b2ac8b113230e014e9 (patch) | |
tree | c742edc471b43ef2e1943332031d4cc4c51b3cd9 | |
parent | 8e149787b10363da6686c9245b3ec25a9f9d6a1c (diff) | |
download | clutter-eb811210e25a2bcc7b9fa8b2ac8b113230e014e9.tar.gz |
flow-layout: Check for all positive values
When creating a FlowLayout container, setting a specific size on it, and
adding a child to it, as per the attached testcase, it crashes. The line
on the backtrace doesn't really make sense, but from looking over it, it
appears that it's probably because priv->line_natural is NULL. The
attached patch makes it so in this case, priv->line_natural is
allocated.
https://bugzilla.gnome.org/show_bug.cgi?id=676068
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
-rw-r--r-- | clutter/clutter-flow-layout.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clutter/clutter-flow-layout.c b/clutter/clutter-flow-layout.c index 38f0fe669..cf951c77b 100644 --- a/clutter/clutter-flow-layout.c +++ b/clutter/clutter-flow-layout.c @@ -572,8 +572,8 @@ clutter_flow_layout_allocate (ClutterLayoutManager *manager, * available size in case the FlowLayout wasn't given the exact * size it requested */ - if ((priv->req_width > 0 && avail_width != priv->req_width) || - (priv->req_height > 0 && avail_height != priv->req_height)) + if ((priv->req_width >= 0 && avail_width != priv->req_width) || + (priv->req_height >= 0 && avail_height != priv->req_height)) { clutter_flow_layout_get_preferred_width (manager, container, avail_height, |