fixed BGI huffman decompression.

This commit is contained in:
morkt
2015-08-29 23:27:00 +04:00
parent a0ae95d1ef
commit 275652e3d7
2 changed files with 3 additions and 3 deletions

View File

@@ -232,7 +232,7 @@ namespace GameRes.Formats.BGI
int child_index = switch_flag;
int depth_existed_nodes = 0;
while (hcode[n].Depth == depth)
while (n < hcode.Length && hcode[n].Depth == depth)
{
var node = new HuffmanNode { IsParent = false, Code = hcode[n++].Code };
hnodes[nodes_index[huffman_nodes_index, depth_existed_nodes]] = node;