From c79009cef8db611f410f358a0556ec980db6b5e7 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Wed, 17 Nov 2021 09:38:21 +0100 Subject: Common 5a0689a and c63fb05 --- lib/edi/common.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/edi') diff --git a/lib/edi/common.cpp b/lib/edi/common.cpp index abaf2ed..c99997a 100644 --- a/lib/edi/common.cpp +++ b/lib/edi/common.cpp @@ -154,6 +154,7 @@ void TagDispatcher::push_bytes(const vector &buf) while (m_input_data.size() > 2) { if (m_input_data[0] == 'A' and m_input_data[1] == 'F') { const auto r = decode_afpacket(m_input_data); + bool leave_loop = false; switch (r.st) { case decode_state_e::Ok: m_last_sequences.pseq_valid = false; @@ -161,9 +162,11 @@ void TagDispatcher::push_bytes(const vector &buf) break; case decode_state_e::MissingData: /* Continue filling buffer */ + leave_loop = true; break; case decode_state_e::Error: m_last_sequences.pseq_valid = false; + leave_loop = true; break; } @@ -174,6 +177,10 @@ void TagDispatcher::push_bytes(const vector &buf) back_inserter(remaining_data)); m_input_data = remaining_data; } + + if (leave_loop) { + break; + } } else if (m_input_data[0] == 'P' and m_input_data[1] == 'F') { PFT::Fragment fragment; -- cgit v1.2.3