From 6fcbf4ca2e78092bf4159c830b6d4cf0dbf23407 Mon Sep 17 00:00:00 2001 From: VaDiM Date: Tue, 16 Dec 2025 03:12:48 +0300 Subject: [PATCH] Fix a bug in the bundle block reader. Close #119 --- AssetStudio/BundleFile.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AssetStudio/BundleFile.cs b/AssetStudio/BundleFile.cs index 9cdd2b1..fed0323 100644 --- a/AssetStudio/BundleFile.cs +++ b/AssetStudio/BundleFile.cs @@ -432,7 +432,8 @@ namespace AssetStudio byte[] sharedUncompressedBuff = null; if (blocksCompression > CompressionType.Lzma && blocksCompression != CompressionType.Lzham) { - sharedCompressedBuff = BigArrayPool.Shared.Rent(blockSize); + var maxCompressedSize = (int)m_BlocksInfo.Max(x => x.compressedSize); + sharedCompressedBuff = BigArrayPool.Shared.Rent(maxCompressedSize); sharedUncompressedBuff = BigArrayPool.Shared.Rent(blockSize); }