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>
This commit is contained in:
Leah Rowe
2026-03-13 01:49:07 +00:00
parent 3245333c53
commit 15079d02bd
+5
View File
@@ -410,10 +410,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;
}