levelbar: fix a crash

We should not try to access a block with an index that exceeds the
number of blocks in the widget.
This commit is contained in:
Cosimo Cecchi 2016-01-02 18:14:47 -08:00
parent 8109520d4e
commit 6322b1f647

View File

@ -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++)