Plane: fixed range check for RC channel

This commit is contained in:
Andrew Tridgell 2019-12-19 17:37:07 +11:00 committed by Randy Mackay
parent 9c327d2fe6
commit b4abab2add
1 changed files with 1 additions and 1 deletions

View File

@ -25,7 +25,7 @@ public:
RC_Channel_Plane obj_channels[NUM_RC_CHANNELS];
RC_Channel_Plane *channel(const uint8_t chan) override {
if (chan > NUM_RC_CHANNELS) {
if (chan >= NUM_RC_CHANNELS) {
return nullptr;
}
return &obj_channels[chan];