flowbox: Avoid a crash in measure()

When the children request a height of zero, the
flowbox measure() function was happily dividing
by that zero, leading to badness.
This commit is contained in:
Matthias Clasen 2020-05-13 20:32:30 -04:00
parent 7915e998e2
commit 33011ccdff

View File

@ -2075,6 +2075,8 @@ gtk_flow_box_measure (GtkWidget *widget,
goto out_width;
get_max_item_size (box, GTK_ORIENTATION_VERTICAL, &min_item_height, &nat_item_height);
if (nat_item_height <= 0)
goto out_width;
/* By default flow at the natural item width */
line_length = avail_size / (nat_item_height + priv->row_spacing);