From e29ca3c0d33e90a226fe600e0054ab44162d370c Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 13 Mar 2026 01:49:07 +0000 Subject: spkmodem-decode: ignore invalid frames when setting bits bits are currently assembled even on invalid frames. this patch fixes that - the bug is also in the GNU version. this reduces the chance of noise/calibration from creating corrupt character output during operation. Signed-off-by: Leah Rowe --- util/spkmodem_decode/spkmodem-decode.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/util/spkmodem_decode/spkmodem-decode.c b/util/spkmodem_decode/spkmodem-decode.c index 2a05d511..a90f3de7 100644 --- a/util/spkmodem_decode/spkmodem-decode.c +++ b/util/spkmodem_decode/spkmodem-decode.c @@ -406,10 +406,15 @@ set_ascii_bit(struct decoder_state *st) { if (st->debug) print_stats(st); + + if (!is_valid_signal(st)) + return st->ascii_bit; + if (st->freq_data < st->freq_threshold) st->ascii |= (1 << st->ascii_bit); st->ascii_bit--; + return st->ascii_bit; } -- cgit v1.2.1