From 5e16c84720c53bff6238630928a36d63106da617 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 9 Oct 2017 11:35:56 +0200 Subject: [PATCH] Add another check for invalid input (std::stoi ignores subsequent symbols) --- src/core/MidiInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/MidiInterface.cpp b/src/core/MidiInterface.cpp index b68aeefe..90082ad0 100644 --- a/src/core/MidiInterface.cpp +++ b/src/core/MidiInterface.cpp @@ -629,7 +629,7 @@ void CCTextField::draw(NVGcontext *vg) { try { *ccNum = std::stoi(text); // Only allow valid cc numbers - if (*ccNum < 0 || *ccNum > 127) { + if (*ccNum < 0 || *ccNum > 127 || text.size() > 3) { text = ""; begin = end = 0; }