From 071a33eb943b4b1e0215b2e63632d379b398ec63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20=C5=9Apiewak?= Date: Mon, 5 Aug 2024 15:17:26 +0200 Subject: [PATCH] Actually init arrays. --- ArcFormats/DxLib/ArcDX8.cs | 2 +- ArcFormats/DxLib/HuffmanDecoder.cs | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ArcFormats/DxLib/ArcDX8.cs b/ArcFormats/DxLib/ArcDX8.cs index 9def10ed..17f7ca2f 100644 --- a/ArcFormats/DxLib/ArcDX8.cs +++ b/ArcFormats/DxLib/ArcDX8.cs @@ -147,7 +147,7 @@ namespace GameRes.Formats.DxLib byte[] huffmanBuffer = new byte[headerBuffer.Length]; byte[] lzBuffer; headerBuffer.CopyTo(huffmanBuffer, 0); - huffmanBuffer = headerBuffer; + //huffmanBuffer = headerBuffer; HuffmanDecoder decoder = new HuffmanDecoder(huffmanBuffer, (ulong)huffmanBuffer.LongLength); lzBuffer = decoder.Unpack(); MemoryStream lzStream = new MemoryStream(lzBuffer); diff --git a/ArcFormats/DxLib/HuffmanDecoder.cs b/ArcFormats/DxLib/HuffmanDecoder.cs index 26dd2e6e..11f61d86 100644 --- a/ArcFormats/DxLib/HuffmanDecoder.cs +++ b/ArcFormats/DxLib/HuffmanDecoder.cs @@ -35,7 +35,7 @@ using GameRes.Utility; namespace GameRes.Formats.DxLib { - internal struct DXA8HuffmanNode + internal class DXA8HuffmanNode { public UInt64 Weight; public int bitNumber; @@ -44,6 +44,13 @@ namespace GameRes.Formats.DxLib public int ParentNode; // index of parent node. public int[] ChildNode; //two children nodes, -1 if not existent. + + DXA8HuffmanNode() + { + bitArray = new byte[32]; + ChildNode = new int[2]; + } + } internal sealed class HuffmanDecoder