summaryrefslogtreecommitdiff
path: root/lib/bk_zip/bk_unzip.cpp
diff options
context:
space:
mode:
authorJeod <47716344+JeodC@users.noreply.github.com>2026-06-22 07:28:04 -0400
committerLywx <kiritodev01@gmail.com>2026-06-29 18:48:27 -0600
commitb42a4fa16f7a75e2a96a7c107e6359c80b685863 (patch)
treeef37e07386cfadfc75bbe586038864e407730ac0 /lib/bk_zip/bk_unzip.cpp
parentec17e8fe49b7bcd9b181e5d0feb05da660c6f061 (diff)
BK64: Add BB romhack support
Diffstat (limited to 'lib/bk_zip/bk_unzip.cpp')
-rw-r--r--lib/bk_zip/bk_unzip.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/bk_zip/bk_unzip.cpp b/lib/bk_zip/bk_unzip.cpp
index f276d07..e1c8ab1 100644
--- a/lib/bk_zip/bk_unzip.cpp
+++ b/lib/bk_zip/bk_unzip.cpp
@@ -89,7 +89,10 @@ uint8_t* bk_unzip(const uint8_t* in_buffer, uint32_t* size) {
// Check for successful decompression:
// - Z_STREAM_END: normal completion
// - Z_BUF_ERROR with no input remaining: input fully consumed
- bool success = (result == Z_STREAM_END) || (result == Z_BUF_ERROR && stream.avail_in == 0);
+ // - Z_BUF_ERROR with output complete: all expected bytes produced (BB-extended ROMs
+ // may have compressed sizes that include trailing padding from adjacent assets)
+ bool success = (result == Z_STREAM_END) || (result == Z_BUF_ERROR && stream.avail_in == 0) ||
+ (result == Z_BUF_ERROR && stream.total_out == expected_len);
// Clean up zlib stream
inflateEnd(&stream);