From 8bbc6c7ade6a16bfddcc9f7cb27d6a3dbc960bad Mon Sep 17 00:00:00 2001 From: ICUMADETHIS Date: Sun, 22 Nov 2026 08:37:42 +0000 Subject: [PATCH] Bound compressed NCZ blocks by their declared output size --- tests/ncz_test.py | 29 +++++++++++++++++++++++++++++ tools/ncz.py | 8 +++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/tests/ncz_test.py b/tests/ncz_test.py index 1c451b2e..21a67de6 100644 --- a/tests/ncz_test.py +++ b/tests/ncz_test.py @@ -66,6 +66,35 @@ def ncz_file(nca, body, blocks=False): return out + b''.join(stored) +class BlocksTest(unittest.TestCase): + def read(self, data, plain=1 << 14): + header = b'NCZBLOCK' + bytes([2, 1, 0, 14]) + struct.pack('