From 4bdd979df6af790b1b1a3f2bfdfb1b266efbe8ac Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 18 Mar 2025 19:55:30 +0100 Subject: [PATCH] Fix index out of bounds when creating group (peek color) --- gtk2_ardour/utils.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index 747c9f134b..6bc56f0887 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -719,14 +719,16 @@ ARDOUR_UI_UTILS::round_robin_palette_color (bool just_peek) std::vector c (gc); static std::vector::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++]; }