From 7d18461d099ee619623d8610b772e74e42f4679c Mon Sep 17 00:00:00 2001 From: Kevin <68612569+diyelectromusic@users.noreply.github.com> Date: Mon, 15 Jan 2024 08:58:20 -0800 Subject: [PATCH] Fix an assert that should be a run-time test. --- src/performanceconfig.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/performanceconfig.cpp b/src/performanceconfig.cpp index 193766a..53a3eeb 100644 --- a/src/performanceconfig.cpp +++ b/src/performanceconfig.cpp @@ -1,3 +1,4 @@ + // // performanceconfig.cpp // @@ -1315,7 +1316,9 @@ std::string CPerformanceConfig::AddPerformanceBankDirName(unsigned nBankID) bool CPerformanceConfig::IsValidPerformanceBank(unsigned nBankID) { - assert (nBankID < NUM_PERFORMANCE_BANKS); + if (nBankID >= NUM_PERFORMANCE_BANKS) { + return false; + } if (m_PerformanceBankName[nBankID].empty()) { return false;