The loop that detects the junk bytes exits:
a) when it reaches the last byte in m_bytes, or
b) when it finds a valid 'first byte'.
The current code drops the first 'idx-1' bytes. This is consistent
with case b), but it left one junk byte in case a).
Let the code dropping all the junk bytes in both the cases above.
This might be more easily and cleanly done with: