Skip to content

Commit

Permalink
fix boundary check
Browse files Browse the repository at this point in the history
  • Loading branch information
dancesWithBugs authored and x42 committed May 28, 2022
1 parent 47c6493 commit e505407
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions libs/surfaces/control_protocol/control_protocol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ ControlProtocol::set_route_table (uint32_t table_index, uint32_t remote_control_
void
ControlProtocol::route_set_rec_enable (uint32_t table_index, bool yn)
{
if (table_index > route_table.size()) {
if (table_index >= route_table.size()) {
return;
}

Expand All @@ -169,7 +169,7 @@ ControlProtocol::route_set_rec_enable (uint32_t table_index, bool yn)
bool
ControlProtocol::route_get_rec_enable (uint32_t table_index)
{
if (table_index > route_table.size()) {
if (table_index >= route_table.size()) {
return false;
}

Expand All @@ -188,7 +188,7 @@ ControlProtocol::route_get_rec_enable (uint32_t table_index)
float
ControlProtocol::route_get_gain (uint32_t table_index)
{
if (table_index > route_table.size()) {
if (table_index >= route_table.size()) {
return 0.0f;
}

Expand All @@ -204,7 +204,7 @@ ControlProtocol::route_get_gain (uint32_t table_index)
void
ControlProtocol::route_set_gain (uint32_t table_index, float gain)
{
if (table_index > route_table.size()) {
if (table_index >= route_table.size()) {
return;
}

Expand All @@ -218,7 +218,7 @@ ControlProtocol::route_set_gain (uint32_t table_index, float gain)
float
ControlProtocol::route_get_effective_gain (uint32_t table_index)
{
if (table_index > route_table.size()) {
if (table_index >= route_table.size()) {
return 0.0f;
}

Expand All @@ -235,7 +235,7 @@ ControlProtocol::route_get_effective_gain (uint32_t table_index)
float
ControlProtocol::route_get_peak_input_power (uint32_t table_index, uint32_t which_input)
{
if (table_index > route_table.size()) {
if (table_index >= route_table.size()) {
return 0.0f;
}

Expand All @@ -251,7 +251,7 @@ ControlProtocol::route_get_peak_input_power (uint32_t table_index, uint32_t whic
bool
ControlProtocol::route_get_muted (uint32_t table_index)
{
if (table_index > route_table.size()) {
if (table_index >= route_table.size()) {
return false;
}

Expand All @@ -267,7 +267,7 @@ ControlProtocol::route_get_muted (uint32_t table_index)
void
ControlProtocol::route_set_muted (uint32_t table_index, bool yn)
{
if (table_index > route_table.size()) {
if (table_index >= route_table.size()) {
return;
}

Expand All @@ -282,7 +282,7 @@ ControlProtocol::route_set_muted (uint32_t table_index, bool yn)
bool
ControlProtocol::route_get_soloed (uint32_t table_index)
{
if (table_index > route_table.size()) {
if (table_index >= route_table.size()) {
return false;
}

Expand All @@ -298,7 +298,7 @@ ControlProtocol::route_get_soloed (uint32_t table_index)
void
ControlProtocol::route_set_soloed (uint32_t table_index, bool yn)
{
if (table_index > route_table.size()) {
if (table_index >= route_table.size()) {
return;
}

Expand All @@ -312,7 +312,7 @@ ControlProtocol::route_set_soloed (uint32_t table_index, bool yn)
string
ControlProtocol:: route_get_name (uint32_t table_index)
{
if (table_index > route_table.size()) {
if (table_index >= route_table.size()) {
return "";
}

Expand Down

0 comments on commit e505407

Please sign in to comment.