rx: skip zero-length packets

If passed on, these cause a segmentation fault in the channel decoder. As
zero-length packets currently make no real sense in this protocol, they are
ignored now.
This commit is contained in:
Thomas Kolb 2024-01-05 13:49:50 +01:00
parent a6f12d876b
commit e807f0617b
1 changed files with 7 additions and 0 deletions

View File

@ -241,6 +241,13 @@ result_t layer1_rx_process(layer1_rx_t *rx, const float complex *samples, size_t
break;
}
// check the payload length
if(rx->payload_len_bytes == 0) {
DEBUG_LOG("Packet length %u is not supported.\n", rx->payload_len_bytes);
rx->state = RX_STATE_ACQUISITION;
break;
}
rx->payload_demod = modcod_create_modem(rx->modcod);
uint16_t payload_bps = modem_get_bps(rx->payload_demod);