mirror of https://gerrit.osmocom.org/osmo-tetra
Make viterbi decoder deterministic in case of bit errors / too few symbols
Running tetra-rx on a capture with lots of bit errors is not deterministic. Investigation with Valgrind shows various errors about uninitialised values in libosmocore's viterbi decoder. The cause appears to lie in @lower_mac/viterbi.c@. The only function there allocates space for 864 symbols and then fills it with the symbols received. However, sym_count is sometimes less than 864, leaving the rest of the array uninitialized. Initializing it with @int8_t vit_inp[864*4] = {0};@ fixes the problem. Change-Id: Ib745c387e21fb81afef69efcf7e46d5d49331c8f Fixes: OS#3410
This commit is contained in:
parent
f51afec8fa
commit
2c19f9856a
|
@ -5,7 +5,7 @@
|
|||
|
||||
void viterbi_dec_sb1_wrapper(const uint8_t *in, uint8_t *out, unsigned int sym_count)
|
||||
{
|
||||
int8_t vit_inp[864*4];
|
||||
int8_t vit_inp[864*4] = {0};
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sym_count*4; i++) {
|
||||
|
|
Loading…
Reference in New Issue