Browse Source

Merge pull request #4774 from DonLakeFlyer/RadioCrash

Setup - Radio: Fix crash from bogus param values
QGC4.4
Don Gagne 8 years ago committed by GitHub
parent
commit
528ba79a80
  1. 2
      src/AutoPilotPlugins/Common/RadioComponentController.cc

2
src/AutoPilotPlugins/Common/RadioComponentController.cc

@ -646,7 +646,7 @@ void RadioComponentController::_setInternalCalibrationValuesFromParameters(void) @@ -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;
}

Loading…
Cancel
Save