Commit a6f6fdcc authored by DonLakeFlyer's avatar DonLakeFlyer

Fix crash from bogus param values

parent b7da6015
...@@ -646,7 +646,7 @@ void RadioComponentController::_setInternalCalibrationValuesFromParameters(void) ...@@ -646,7 +646,7 @@ void RadioComponentController::_setInternalCalibrationValuesFromParameters(void)
if (paramFact) { if (paramFact) {
paramChannel = paramFact->rawValue().toInt(); paramChannel = paramFact->rawValue().toInt();
if (paramChannel != 0) { if (paramChannel > 0 && paramChannel <= _chanMax()) {
_rgFunctionChannelMapping[i] = paramChannel - 1; _rgFunctionChannelMapping[i] = paramChannel - 1;
_rgChannelInfo[paramChannel - 1].function = (enum rcCalFunctions)i; _rgChannelInfo[paramChannel - 1].function = (enum rcCalFunctions)i;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment