This commit is contained in:
Igor Pavlov
2018-01-11 22:16:32 +01:00
committed by Kornel
parent b5dc853b24
commit da28077952
44 changed files with 853 additions and 366 deletions
+5 -1
View File
@@ -411,9 +411,13 @@ SRes CBase::ReadBlock2()
lens[state4] = (Byte)state3;
state5 = 0;
}
// lbzip2 2.5 can produce dummy tree, where lens[i] = kMaxHuffmanLen
// BuildFull() returns error for such tree
/*
for (unsigned i = state4; i < kMaxAlphaSize; i++)
lens[i] = 0;
if (!huffs[state2].Build(lens))
*/
if (!huffs[state2].BuildFull(lens, state4))
return SZ_ERROR_DATA;
@@ -474,7 +478,7 @@ SRes CBase::ReadBlock2()
for (len = kNumTableBits + 1; val >= huff->_limits[len]; len++);
/*
if (len > kNumBitsMax)
return SZ_ERROR_DATA;
return SZ_ERROR_DATA; // that check is required, if NHuffman::Build() was used instead of BuildFull()
*/
if (_numBits < len)
{