From 2ab5b1da0ceb05ed9001ff06b1da9453b28c17db Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Mon, 24 Mar 2014 19:18:14 +0100 Subject: [PATCH] AutomatableModel: always fit value from linked model When using value from linked model, make sure to fit it into own range as otherwise this can cause out-of-boundary accesses e.g. in ComboBoxModel. Closes #505. --- src/core/AutomatableModel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/AutomatableModel.cpp b/src/core/AutomatableModel.cpp index 671fb5aa7..7a7bc74c4 100644 --- a/src/core/AutomatableModel.cpp +++ b/src/core/AutomatableModel.cpp @@ -445,10 +445,10 @@ float AutomatableModel::controllerValue( int frameOffset ) const AutomatableModel* lm = m_linkedModels.first(); if( lm->controllerConnection() ) { - return lm->controllerValue( frameOffset ); + return fittedValue( lm->controllerValue( frameOffset ) ); } - return lm->m_value; + return fittedValue( lm->m_value ); }