From a00fcbaa8fb019b87189de94bbe6857c34f8539f Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Sat, 26 Sep 2015 14:37:21 -0700 Subject: [PATCH] Unstuffing pattern length of zero should never match. --- firmware/baseband/symbol_coding.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/firmware/baseband/symbol_coding.hpp b/firmware/baseband/symbol_coding.hpp index 2f8d75b91..f13965a9e 100644 --- a/firmware/baseband/symbol_coding.hpp +++ b/firmware/baseband/symbol_coding.hpp @@ -50,7 +50,8 @@ public: const uint32_t pattern, const size_t length ) { - match = pattern; + // Ensure that length=0 (unstuffing disabled) never matches. + match = length ? pattern : 1; mask = (1U << length) - 1; reset(); }