kopia lustrzana https://github.com/Guenael/rtlsdr-wsprd
The encode function in fano.c writes to (2*8*nbytes) chars of symbols.
1) Correct the comment in fano.c to show correct number 2) Make the size of channelbits large enough by using the formula instead of a constant. With the smaller value the array was being overwritten which caused stack corruption on my system.pull/22/head
rodzic
7e422a1c72
commit
b5d0500cfc
2
fano.c
2
fano.c
|
@ -61,7 +61,7 @@ struct node {
|
|||
* and easier than trying to pack them more compactly.
|
||||
*/
|
||||
int encode(
|
||||
unsigned char *symbols, // Output buffer, 2*nbytes
|
||||
unsigned char *symbols, // Output buffer, 2*8*nbytes
|
||||
unsigned char *data, // Input buffer, nbytes
|
||||
unsigned int nbytes) { // Number of bytes in data
|
||||
unsigned long encstate;
|
||||
|
|
|
@ -300,7 +300,7 @@ int get_wspr_channel_symbols(char* rawmessage, char* hashtab, unsigned char* sym
|
|||
// printf("Will decode as: %s\n",check_call_loc_pow);
|
||||
|
||||
unsigned int nbytes=11; // The message with tail is packed into 11 bytes.
|
||||
unsigned int nencoded=162;
|
||||
unsigned int nencoded=(nbytes * 2 * 8); // This is how much encode() writes
|
||||
unsigned char channelbits[nencoded];
|
||||
memset(channelbits,0,sizeof(char)*nencoded);
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue