diff --git a/plugins/plot_barcol/gog-barcol.c b/plugins/plot_barcol/gog-barcol.c
index df568df..c8edc41 100644
--- a/plugins/plot_barcol/gog-barcol.c
+++ b/plugins/plot_barcol/gog-barcol.c
@@ -613,7 +613,7 @@ gog_barcol_view_render (GogView *view, GogViewAllocation const *bbox)
 	label_pos = g_alloca (num_series * sizeof (gpointer));
 
 	i = 0;
-	for (ptr = gog_1_5d_model->base.series ; ptr != NULL ; ptr = ptr->next, i++) {
+	for (ptr = gog_1_5d_model->base.series ; ptr != NULL && i < num_series ; ptr = ptr->next, i++) {
 		series = ptr->data;
 		base_series = GOG_SERIES (series);
 		if (!gog_series_is_valid (base_series)) {
@@ -651,6 +651,7 @@ gog_barcol_view_render (GogView *view, GogViewAllocation const *bbox)
 		} else
 			label_pos[i] = NULL;
 	}
+	num_series = i;
 
 	/* work in coordinates drawing bars from the top */
 	col_step = 1. - model->overlap_percentage / 100.;
