From 58b72e383664a9d17e0c16a4ed7fa27d3e52df0b Mon Sep 17 00:00:00 2001 From: elsid Date: Tue, 20 Aug 2024 23:55:00 +0200 Subject: [PATCH] Access channels and controls via at function To avoid UB on out of range access. --- extern/oics/ICSInputControlSystem.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extern/oics/ICSInputControlSystem.h b/extern/oics/ICSInputControlSystem.h index aa37c4a124..f0736409c9 100644 --- a/extern/oics/ICSInputControlSystem.h +++ b/extern/oics/ICSInputControlSystem.h @@ -84,11 +84,11 @@ namespace ICS // in seconds void update(float timeSinceLastFrame); - inline Channel* getChannel(int i){ return mChannels[i]; }; + Channel* getChannel(int i){ return mChannels.at(i); }; float getChannelValue(int i); inline int getChannelCount(){ return (int)mChannels.size(); }; - inline Control* getControl(int i){ return mControls[i]; }; + Control* getControl(int i){ return mControls.at(i); }; float getControlValue(int i); inline int getControlCount(){ return (int)mControls.size(); }; inline void addControl(Control* control){ mControls.push_back(control); };