diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-05-13 20:32:30 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-05-13 21:47:11 -0400 |
commit | 33011ccdff4a0167de1d1fe415819736cf97875f (patch) | |
tree | 1a6cc7cece92c976f2a332c2bbac191825459cfc /gtk | |
parent | 7915e998e2459eee04f0fc52d018183d26c2a4d2 (diff) | |
download | gtk+-33011ccdff4a0167de1d1fe415819736cf97875f.tar.gz |
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.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkflowbox.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c index 26b78e3fa3..5c022d45cd 100644 --- a/gtk/gtkflowbox.c +++ b/gtk/gtkflowbox.c @@ -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); |