Tracker: 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 b671d03cf0
commit 1c94b40744

View File

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