Skip to content

Commit e505407

Browse files
dancesWithBugsx42
dancesWithBugs
authored andcommitted
fix boundary check
1 parent 47c6493 commit e505407

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

libs/surfaces/control_protocol/control_protocol.cc

+11-11
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ ControlProtocol::set_route_table (uint32_t table_index, uint32_t remote_control_
153153
void
154154
ControlProtocol::route_set_rec_enable (uint32_t table_index, bool yn)
155155
{
156-
if (table_index > route_table.size()) {
156+
if (table_index >= route_table.size()) {
157157
return;
158158
}
159159

@@ -169,7 +169,7 @@ ControlProtocol::route_set_rec_enable (uint32_t table_index, bool yn)
169169
bool
170170
ControlProtocol::route_get_rec_enable (uint32_t table_index)
171171
{
172-
if (table_index > route_table.size()) {
172+
if (table_index >= route_table.size()) {
173173
return false;
174174
}
175175

@@ -188,7 +188,7 @@ ControlProtocol::route_get_rec_enable (uint32_t table_index)
188188
float
189189
ControlProtocol::route_get_gain (uint32_t table_index)
190190
{
191-
if (table_index > route_table.size()) {
191+
if (table_index >= route_table.size()) {
192192
return 0.0f;
193193
}
194194

@@ -204,7 +204,7 @@ ControlProtocol::route_get_gain (uint32_t table_index)
204204
void
205205
ControlProtocol::route_set_gain (uint32_t table_index, float gain)
206206
{
207-
if (table_index > route_table.size()) {
207+
if (table_index >= route_table.size()) {
208208
return;
209209
}
210210

@@ -218,7 +218,7 @@ ControlProtocol::route_set_gain (uint32_t table_index, float gain)
218218
float
219219
ControlProtocol::route_get_effective_gain (uint32_t table_index)
220220
{
221-
if (table_index > route_table.size()) {
221+
if (table_index >= route_table.size()) {
222222
return 0.0f;
223223
}
224224

@@ -235,7 +235,7 @@ ControlProtocol::route_get_effective_gain (uint32_t table_index)
235235
float
236236
ControlProtocol::route_get_peak_input_power (uint32_t table_index, uint32_t which_input)
237237
{
238-
if (table_index > route_table.size()) {
238+
if (table_index >= route_table.size()) {
239239
return 0.0f;
240240
}
241241

@@ -251,7 +251,7 @@ ControlProtocol::route_get_peak_input_power (uint32_t table_index, uint32_t whic
251251
bool
252252
ControlProtocol::route_get_muted (uint32_t table_index)
253253
{
254-
if (table_index > route_table.size()) {
254+
if (table_index >= route_table.size()) {
255255
return false;
256256
}
257257

@@ -267,7 +267,7 @@ ControlProtocol::route_get_muted (uint32_t table_index)
267267
void
268268
ControlProtocol::route_set_muted (uint32_t table_index, bool yn)
269269
{
270-
if (table_index > route_table.size()) {
270+
if (table_index >= route_table.size()) {
271271
return;
272272
}
273273

@@ -282,7 +282,7 @@ ControlProtocol::route_set_muted (uint32_t table_index, bool yn)
282282
bool
283283
ControlProtocol::route_get_soloed (uint32_t table_index)
284284
{
285-
if (table_index > route_table.size()) {
285+
if (table_index >= route_table.size()) {
286286
return false;
287287
}
288288

@@ -298,7 +298,7 @@ ControlProtocol::route_get_soloed (uint32_t table_index)
298298
void
299299
ControlProtocol::route_set_soloed (uint32_t table_index, bool yn)
300300
{
301-
if (table_index > route_table.size()) {
301+
if (table_index >= route_table.size()) {
302302
return;
303303
}
304304

@@ -312,7 +312,7 @@ ControlProtocol::route_set_soloed (uint32_t table_index, bool yn)
312312
string
313313
ControlProtocol:: route_get_name (uint32_t table_index)
314314
{
315-
if (table_index > route_table.size()) {
315+
if (table_index >= route_table.size()) {
316316
return "";
317317
}
318318

0 commit comments

Comments
 (0)