mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 00:43:35 +08:00
gps_blending add protection against accessing non-exist array item
This commit is contained in:
committed by
Lorenz Meier
parent
a0d500b30a
commit
8087fac3fc
@@ -67,8 +67,10 @@ public:
|
||||
|
||||
void setGpsData(const sensor_gps_s &gps_data, int instance)
|
||||
{
|
||||
_gps_state[instance] = gps_data;
|
||||
_gps_updated[instance] = true;
|
||||
if (instance < GPS_MAX_RECEIVERS_BLEND) {
|
||||
_gps_state[instance] = gps_data;
|
||||
_gps_updated[instance] = true;
|
||||
}
|
||||
}
|
||||
void setBlendingUseSpeedAccuracy(bool enabled) { _blend_use_spd_acc = enabled; }
|
||||
void setBlendingUseHPosAccuracy(bool enabled) { _blend_use_hpos_acc = enabled; }
|
||||
|
||||
Reference in New Issue
Block a user