From 6322b1f647552d9da0d3524731b56b7a1a23c060 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Sat, 2 Jan 2016 18:14:47 -0800 Subject: [PATCH] levelbar: fix a crash We should not try to access a block with an index that exceeds the number of blocks in the widget. --- gtk/gtklevelbar.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gtk/gtklevelbar.c b/gtk/gtklevelbar.c index 45d9d4a0c6..7259f85de5 100644 --- a/gtk/gtklevelbar.c +++ b/gtk/gtklevelbar.c @@ -712,6 +712,8 @@ update_level_style_classes (GtkLevelBar *self) num_blocks = (gint) round (priv->max_value) - (gint) round (priv->min_value); } + num_filled = MIN (num_blocks, num_filled); + classes[0] = "filled"; classes[1] = value_class; for (i = 0; i < num_filled; i++)