From a6f6fdcc218aa2f601b0aee0a04af5b63c4465be Mon Sep 17 00:00:00 2001 From: DonLakeFlyer Date: Wed, 15 Mar 2017 09:57:57 -0700 Subject: [PATCH] Fix crash from bogus param values --- src/AutoPilotPlugins/Common/RadioComponentController.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AutoPilotPlugins/Common/RadioComponentController.cc b/src/AutoPilotPlugins/Common/RadioComponentController.cc index 59c84b856..50d7cc750 100644 --- a/src/AutoPilotPlugins/Common/RadioComponentController.cc +++ b/src/AutoPilotPlugins/Common/RadioComponentController.cc @@ -646,7 +646,7 @@ void RadioComponentController::_setInternalCalibrationValuesFromParameters(void) if (paramFact) { paramChannel = paramFact->rawValue().toInt(); - if (paramChannel != 0) { + if (paramChannel > 0 && paramChannel <= _chanMax()) { _rgFunctionChannelMapping[i] = paramChannel - 1; _rgChannelInfo[paramChannel - 1].function = (enum rcCalFunctions)i; } -- 2.22.0