From d37e1dae5ea2f9f6567426cbd9fdff3a56504580 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 10 Aug 2026 18:36:15 -0400 Subject: [PATCH] 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 --- modemm17/Viterbi.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modemm17/Viterbi.h b/modemm17/Viterbi.h index 427f46408..1d2324c2a 100644 --- a/modemm17/Viterbi.h +++ b/modemm17/Viterbi.h @@ -111,7 +111,8 @@ struct Viterbi state_transition_t nextState_; 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 // other modes, this may need to be increased. This will never overflow