diff --git a/src/comm/MAVLinkSimulationLink.cc b/src/comm/MAVLinkSimulationLink.cc index 9545abc73a42cf7035b5f43b450efefc0147ed7f..35c06b26097b344c8a7003b22bbbc746029a949e 100644 --- a/src/comm/MAVLinkSimulationLink.cc +++ b/src/comm/MAVLinkSimulationLink.cc @@ -677,6 +677,9 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size) int streampointer = 0; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; int bufferlength = 0; + + // Initialize drop count to 0 so it isn't referenced uninitialized when returned at the bottom of this function + comm.packet_rx_drop_count = 0; // Output all bytes as hex digits for (int i=0; i