$FreeWRT$ --- lzma-432.orig/C/7zip/Compress/LZMA/LZMADecoder.cpp Thu Sep 22 08:55:12 2005 +++ lzma-432/C/7zip/Compress/LZMA/LZMADecoder.cpp Thu Jul 27 10:24:33 2006 @@ -274,12 +274,17 @@ STDMETHODIMP CDecoder::SetDecoderPropert Byte remainder = (Byte)(properties[0] / 9); int lp = remainder % 5; int pb = remainder / 5; - if (pb > NLength::kNumPosStatesBitsMax) - return E_INVALIDARG; - _posStateMask = (1 << pb) - 1; UInt32 dictionarySize = 0; for (int i = 0; i < 4; i++) dictionarySize += ((UInt32)(properties[1 + i])) << (i * 8); + return SetDecoderPropertiesRaw(lc, lp, pb, dictionarySize); +} + +STDMETHODIMP CDecoder::SetDecoderPropertiesRaw(int lc, int lp, int pb, UInt32 dictionarySize) +{ + if (pb > NLength::kNumPosStatesBitsMax) + return E_INVALIDARG; + _posStateMask = (1 << pb) - 1; if (!_outWindowStream.Create(dictionarySize)) return E_OUTOFMEMORY; if (!_literalDecoder.Create(lp, lc))