From eac564a315238fb0a29c42a92d4f16fc4dd42a46 Mon Sep 17 00:00:00 2001 From: Raoul Wols Date: Thu, 20 Mar 2025 14:02:49 +0100 Subject: [PATCH] Handle zero tag length close #37 --- trsfile/engine/trs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/trsfile/engine/trs.py b/trsfile/engine/trs.py index 80e3b9f..c4eabd8 100644 --- a/trsfile/engine/trs.py +++ b/trsfile/engine/trs.py @@ -534,6 +534,8 @@ def __read_headers(self) -> None: if (tag_length & 0x80) != 0: tag_length = int.from_bytes(self.handle.read(tag_length & 0x7F), 'little') + if tag_length == 0 and tag != Header.TRACE_BLOCK.value: + continue # Obtain the Value tag_value_index = self.handle.tell()