From fbb7948c131d10c07e23a6819759f7c51d792edc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 19 Jun 2020 05:58:09 +0200 Subject: [PATCH] stack: Avoid using an uninitialized value This was showing up as criticals since for_size != >= -1. --- gtk/gtkstack.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c index 9f8376e5d3..b37769dac5 100644 --- a/gtk/gtkstack.c +++ b/gtk/gtkstack.c @@ -2300,9 +2300,6 @@ gtk_stack_size_allocate (GtkWidget *widget, GtkStackPrivate *priv = gtk_stack_get_instance_private (stack); GtkAllocation child_allocation; - child_allocation.x = get_bin_window_x (stack); - child_allocation.y = get_bin_window_y (stack); - if (priv->last_visible_child) { int child_width, child_height; @@ -2313,7 +2310,7 @@ gtk_stack_size_allocate (GtkWidget *widget, &min, &nat, NULL, NULL); child_width = MAX (min, width); gtk_widget_measure (priv->last_visible_child->widget, GTK_ORIENTATION_VERTICAL, - child_allocation.width, + child_width, &min, &nat, NULL, NULL); child_height = MAX (min, height); @@ -2321,6 +2318,8 @@ gtk_stack_size_allocate (GtkWidget *widget, &(GtkAllocation) { 0, 0, child_width, child_height }, -1); } + child_allocation.x = get_bin_window_x (stack); + child_allocation.y = get_bin_window_y (stack); child_allocation.width = width; child_allocation.height = height;