From 37b6f040cac8b315d95fb41ab9c8e857b78bf040 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 1 Feb 2020 11:22:31 +0000 Subject: [PATCH] Prevent out of bounds parameter touch in carla-native plugin Fixes #992 Signed-off-by: falkTX --- source/backend/engine/CarlaEngineNative.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/backend/engine/CarlaEngineNative.cpp b/source/backend/engine/CarlaEngineNative.cpp index 0e6a06f03..34bba7b97 100644 --- a/source/backend/engine/CarlaEngineNative.cpp +++ b/source/backend/engine/CarlaEngineNative.cpp @@ -366,7 +366,7 @@ public: } } - void setParameterTouchFromUI(const uint32_t pluginId, uint32_t index, const bool touch) + void setParameterTouchFromUI(const uint32_t pluginId, const uint32_t index, const bool touch) { uint32_t rindex = index; if (_getRealIndexForPluginParameter(pluginId, rindex)) @@ -1714,6 +1714,9 @@ private: rindex += plugin->getParameterCount(); } + if (rindex >= kNumInParams) + return false; + return true; }