Fixed segmentation fault in fractional_decimator_ff

This commit is contained in:
Andras Retzler 2017-04-02 21:23:47 +00:00
parent c3e5d3f433
commit d56fc2d799
2 changed files with 2 additions and 0 deletions

1
csdr.c
View file

@ -1372,6 +1372,7 @@ int main(int argc, char *argv[])
fread(input_buffer+(the_bufsize-d.input_processed), sizeof(float), d.input_processed, stdin); fread(input_buffer+(the_bufsize-d.input_processed), sizeof(float), d.input_processed, stdin);
fractional_decimator_ff(input_buffer, output_buffer, the_bufsize, &d); fractional_decimator_ff(input_buffer, output_buffer, the_bufsize, &d);
fwrite(output_buffer, sizeof(float), d.output_size, stdout); fwrite(output_buffer, sizeof(float), d.output_size, stdout);
//fprintf(stderr, "os = %d, ip = %d\n", d.output_size, d.input_processed);
TRY_YIELD; TRY_YIELD;
} }
} }

View file

@ -714,6 +714,7 @@ fractional_decimator_ff_t fractional_decimator_ff_init(float rate, int num_poly_
d.rate = rate; d.rate = rate;
d.taps = taps; d.taps = taps;
d.taps_length = taps_length; d.taps_length = taps_length;
d.input_processed = 0;
return d; return d;
} }