Browse Source

AP_NavEKF3: fixed null dereference of airspeed

this caused a segfault in replay
c415-sdk
Andrew Tridgell 4 years ago
parent
commit
ac4a05ffbf
  1. 2
      libraries/AP_NavEKF3/AP_NavEKF3_Outputs.cpp

2
libraries/AP_NavEKF3/AP_NavEKF3_Outputs.cpp

@ -46,7 +46,7 @@ float NavEKF3_core::errorScore() const @@ -46,7 +46,7 @@ float NavEKF3_core::errorScore() const
// EKF less sensitive to innovations arising due events like strong gusts of wind, thus, prevent reporting high error scores
if (assume_zero_sideslip()) {
const auto *arsp = dal.airspeed();
if (arsp->get_num_sensors() >= 2 && (frontend->_affinity & EKF_AFFINITY_ARSP)) {
if (arsp != nullptr && arsp->get_num_sensors() >= 2 && (frontend->_affinity & EKF_AFFINITY_ARSP)) {
score = MAX(score, 0.3f * tasTestRatio);
}
}

Loading…
Cancel
Save