Fix index out of bounds when creating group (peek color)

This commit is contained in:
Robin Gareus
2025-03-18 19:55:30 +01:00
parent 7fcc048583
commit 4bdd979df6

View File

@@ -719,14 +719,16 @@ ARDOUR_UI_UTILS::round_robin_palette_color (bool just_peek)
std::vector<Gdk::Color> c (gc);
static std::vector<Gdk::Color>::size_type index = 0;
if(just_peek) {
return c[index];
}
assert (c.size() > 0);
if (index >= c.size ()) {
index = 0;
}
if(just_peek) {
return c[index];
}
return c[index++];
}