commit f2ca7b9de15a8dcc6d8cb09bdd1f2136eb4b7711
parent b869f8d9d90a75b37e302e136341357483b2754e
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date: Mon, 28 Feb 2022 20:06:09 +0100
fix crash because Juce wants to paint a list row that is out of bounds
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/source/jucePlugin/ui/Virus_PatchBrowser.cpp b/source/jucePlugin/ui/Virus_PatchBrowser.cpp
@@ -264,6 +264,9 @@ void PatchBrowser::paintCell(Graphics &g, int rowNumber, int columnId, int width
g.setColour(rowIsSelected ? Colours::darkblue
: getLookAndFeel().findColour(ListBox::textColourId)); // [5]
+ if (rowNumber >= getNumRows())
+ return; // Juce what are you up to?
+
const auto rowElement = m_filteredPatches[rowNumber];
//auto text = rowElement.name;
String text = "";