diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2018-01-12 00:16:32 +0300 |
---|---|---|
committer | Kornel <kornel@geekhood.net> | 2018-01-12 00:16:32 +0300 |
commit | da28077952faf9e716ed7987b842d31617a10125 (patch) | |
tree | 5903be6aa5f1405d54028cec42432c46df818af5 /CPP/7zip/Compress/BZip2Decoder.cpp | |
parent | b5dc853b2496447f0a54b3b25cb2659b575c56ef (diff) |
18.0018.00
Diffstat (limited to 'CPP/7zip/Compress/BZip2Decoder.cpp')
-rw-r--r-- | CPP/7zip/Compress/BZip2Decoder.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/CPP/7zip/Compress/BZip2Decoder.cpp b/CPP/7zip/Compress/BZip2Decoder.cpp index 62fa26d0..b414d088 100644 --- a/CPP/7zip/Compress/BZip2Decoder.cpp +++ b/CPP/7zip/Compress/BZip2Decoder.cpp @@ -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) { |