correct handling of array index to avoid segfault

3.8
jmfriedt 2023-02-22 09:42:12 +01:00
parent cb3e8b529b
commit ba2f02b23f
2 changed files with 5 additions and 16 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

@ -465,7 +465,6 @@ do {
//encode the rest of the frame
conv_Encode_Frame(&enc_bits[96], data, _fn);
//reorder bits
for(uint16_t i=0; i<SYM_PER_PLD*2; i++)
rf_bits[i]=enc_bits[intrl_seq[i]];
@ -481,12 +480,6 @@ do {
rf_bits[i]=1;
}
}
//send dummy symbols (debug)
/*float s=0.0;
for(uint8_t i=0; i<SYM_PER_PLD; i++) //40ms * 4800 - 8 (syncword)
write(STDOUT_FILENO, (uint8_t*)&s, sizeof(float));*/
float s;
for(uint16_t i=0; i<SYM_PER_PLD; i++) //40ms * 4800 - 8 (syncword)
{
@ -504,9 +497,6 @@ do {
//increment the Frame Number
_fn++;
//debug-only
if(_fn==6*10)
return 0;
}
else //LSF
{
@ -580,11 +570,10 @@ printf("got_lsf=1\n");
printf("\n");*/
}
}
} while (countin+16<=noutput_items);
} while (countout+16<=noutput_items);
// Tell runtime system how many input items we consumed on
// each input stream.
consume_each (countin);
// printf("\nnoutput_items=%d countin=%d countout=%d\n",noutput_items,countin,countout);
// Tell runtime system how many output items we produced.
return countout;
}