Skip to content

Commit

Permalink
MixerLine.cpp: Fix range checks in setFx / get Fx
Browse files Browse the repository at this point in the history
  • Loading branch information
mauser committed Sep 16, 2019
1 parent bfbc05f commit af76163
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gui/src/Mixer/MixerLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,17 +395,17 @@ void MixerLine::knobChanged(Knob* pRef)

void MixerLine::setFXLevel( uint nFX, float fValue )
{
if (nFX > MAX_FX) {
ERRORLOG( QString("[setFXLevel] nFX > MAX_FX (nFX=%1)").arg(nFX) );
if (nFX >= MAX_FX) {
ERRORLOG( QString("[setFXLevel] nFX >= MAX_FX (nFX=%1)").arg(nFX) );
return;
}
m_pKnob[nFX]->setValue( fValue );
}

float MixerLine::getFXLevel(uint nFX)
{
if (nFX > MAX_FX) {
ERRORLOG( QString("[setFXLevel] nFX > MAX_FX (nFX=%1)").arg(nFX) );
if (nFX >= MAX_FX) {
ERRORLOG( QString("[setFXLevel] nFX >= MAX_FX (nFX=%1)").arg(nFX) );
return 0.0f;
}
return m_pKnob[nFX]->getValue();
Expand Down

0 comments on commit af76163

Please sign in to comment.