AP_ExternalAHRS: fixes from --ubsan autotest

This commit is contained in:
Andrew Tridgell 2022-07-21 11:19:55 +10:00
parent 286ea7499b
commit c2b29a92c7
1 changed files with 1 additions and 1 deletions

View File

@ -292,7 +292,7 @@ void AP_ExternalAHRS_LORD::handle_gnss(const LORD_Packet &packet)
switch ((GNSSPacketField) packet.payload[i+1]) {
// GPS Time
case GNSSPacketField::GPS_TIME: {
gnss_data.tow_ms = extract_double(packet.payload, i+2) * 1000; // Convert seconds to ms
gnss_data.tow_ms = double_to_uint32(extract_double(packet.payload, i+2) * 1000); // Convert seconds to ms
gnss_data.week = be16toh_ptr(&packet.payload[i+10]);
break;
}