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:
Jan Hrach 2018-07-21 10:26:27 +02:00 committed by Harald Welte
parent f51afec8fa
commit 2c19f9856a
1 changed files with 1 additions and 1 deletions

View File

@ -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++) {