From 4d250d90dfc8c0580627f896a2c316b861431abf Mon Sep 17 00:00:00 2001 From: Simon Wood Date: Thu, 12 Sep 2024 19:30:32 -0600 Subject: [PATCH] Work around bug #76 decoding particular MS+ effect --- zoomzt2.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zoomzt2.py b/zoomzt2.py index f778509..6417580 100644 --- a/zoomzt2.py +++ b/zoomzt2.py @@ -89,7 +89,11 @@ TXE1 = Struct( Const(b"TXE1"), "length" / Int32ul, - "description" / PaddedString(this.length, "ascii"), + "peekdescription" / Peek(FixedSized(this.length, PaddedString(this.length, "ascii"))), + "description" / IfThenElse(lambda ctx: ctx.peekdescription == None, + "description" / Bytes(this.length), + "description" / PaddedString(this.length, "ascii"), + ), ) INFO = Struct(