summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-13 01:49:07 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-13 01:49:07 +0000
commite29ca3c0d33e90a226fe600e0054ab44162d370c (patch)
tree77ab6d62de392405518aaeb84cf95eb17bb04313
parent1ec8bfbe91615bd6e451b186fc87f6b6c165477d (diff)
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 <leah@libreboot.org>
-rw-r--r--util/spkmodem_decode/spkmodem-decode.c5
1 files changed, 5 insertions, 0 deletions
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;
}