Skip to content

Commit

Permalink
Bound the lastPBByChannel in case called with channel -1 in a wildcard (
Browse files Browse the repository at this point in the history
  • Loading branch information
baconpaul authored Jul 29, 2024
1 parent 526fa50 commit 56ee211
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/sst/voicemanager/managers/polymanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ template <typename Cfg, typename Responder> struct PolyManager
std::array<uint16_t, 16> lastPBByChannel{};
void routeMIDIPitchBend(int16_t port, int16_t channel, uint16_t pb14bit)
{
lastPBByChannel[channel] = pb14bit - 8192;
if (channel >= 0 && channel < lastPBByChannel.size())
lastPBByChannel[channel] = pb14bit - 8192;

for (auto &vi : voiceInfo)
{
if (vi.matches(port, channel, -1, -1)) // all keys and notes on a channel for midi PB
Expand Down

0 comments on commit 56ee211

Please sign in to comment.