Browse Source

ft4: Initialize uninitialized phase variable in soft decoder

Coverity reported an uninitialized scalar variable in FT4::soft_c2m().
Initialize the maximum tone phase value to avoid using an undefined value
when no tone exceeds the initial magnitude threshold.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
chirpmodem-v8.0.0
Robin Getz 4 months ago
parent
commit
f5d2bca4f6
No known key found for this signature in database
GPG Key ID: 51C7231FFED0E060
  1. 2
      ft8/ft4.cpp

2
ft8/ft4.cpp

@ -1452,7 +1452,7 @@ std::vector<std::vector<float>> FT4::soft_c2m(const FFTEngine::ffts_t &c103) con @@ -1452,7 +1452,7 @@ std::vector<std::vector<float>> FT4::soft_c2m(const FFTEngine::ffts_t &c103) con
{
m103[si].resize(4);
float mx = -std::numeric_limits<float>::infinity();
float mx_phase;
float mx_phase = 0.0f;
for (int bi = 0; bi < 4; bi++)
{

Loading…
Cancel
Save