Browse Source

modemm17: initialize Viterbi metric buffers

Initialize prevMetrics and currMetrics so the metric buffers are not left
indeterminate during construction. Both buffers are explicitly populated
before their contents are used, so this is defensive initialization rather
than a functional fix.

Detected by cppcheck.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
chirpmodem-v8.0.0
Robin Getz 3 months ago
parent
commit
d37e1dae5e
No known key found for this signature in database
GPG Key ID: 51C7231FFED0E060
  1. 3
      modemm17/Viterbi.h

3
modemm17/Viterbi.h

@ -111,7 +111,8 @@ struct Viterbi
state_transition_t nextState_; state_transition_t nextState_;
state_transition_t prevState_; state_transition_t prevState_;
metrics_t prevMetrics, currMetrics; metrics_t prevMetrics{};
metrics_t currMetrics{};
// This is the maximum amount of storage needed for M17. If used for // This is the maximum amount of storage needed for M17. If used for
// other modes, this may need to be increased. This will never overflow // other modes, this may need to be increased. This will never overflow

Loading…
Cancel
Save