4.27 beta

This commit is contained in:
Igor Pavlov
2005-09-21 00:00:00 +00:00
committed by Kornel Lesiński
parent 31e7b924e8
commit d66cf2fcf3
393 changed files with 17345 additions and 4743 deletions

View File

@@ -23,4 +23,4 @@ class CBZip2CRCTableInit
{
public:
CBZip2CRCTableInit() { CBZip2CRC::InitTable(); }
} g_CRCTableInit;
} g_BZip2CRCTableInit;

View File

@@ -174,7 +174,8 @@ HRESULT CDecoder::ReadBlock(UInt32 blockSizeMax, CState &state)
}
for (; i < kMaxAlphaSize; i++)
lens[i] = 0;
m_HuffmanDecoders[t].SetCodeLengths(lens);
if(!m_HuffmanDecoders[t].SetCodeLengths(lens))
return S_FALSE;
}
while(++t < numTables);
@@ -202,7 +203,7 @@ HRESULT CDecoder::ReadBlock(UInt32 blockSizeMax, CState &state)
}
groupSize--; \
int nextSym = (int)huffmanDecoder->DecodeSymbol(&m_InStream);
UInt32 nextSym = huffmanDecoder->DecodeSymbol(&m_InStream);
if (nextSym < 2)
{
@@ -220,13 +221,18 @@ HRESULT CDecoder::ReadBlock(UInt32 blockSizeMax, CState &state)
while(--runCounter != 0);
runPower = 0;
}
if (nextSym > numInUse)
if (nextSym <= (UInt32)numInUse)
{
Byte b = mtf.GetAndMove((int)nextSym - 1);
if (blockSize >= blockSizeMax)
return S_FALSE;
state.CharCounters[b]++;
state.tt[blockSize++] = (UInt32)b;
}
else if (nextSym == (UInt32)numInUse + 1)
break;
Byte b = mtf.GetAndMove(nextSym - 1);
if (blockSize >= blockSizeMax)
else
return S_FALSE;
state.CharCounters[b]++;
state.tt[blockSize++] = (UInt32)b;
}
}
if (state.OrigPtr >= blockSize)