4.35 beta

This commit is contained in:
Igor Pavlov
2006-03-03 00:00:00 +00:00
committed by Kornel Lesiński
parent 0f60a4933b
commit 191cf6781a
16 changed files with 156 additions and 53 deletions

View File

@@ -27,9 +27,9 @@ public:
bool CopyBlock(UInt32 distance, UInt32 len)
{
UInt32 pos = _pos - distance - 1;
if (pos >= _bufferSize)
if (distance >= _pos)
{
if (!_overDict)
if (!_overDict || distance >= _bufferSize)
return false;
pos += _bufferSize;
}

View File

@@ -152,7 +152,7 @@ int main2(int n, const char *args[])
g_IsNT = IsItWindowsNT();
#endif
fprintf(stderr, "\nLZMA 4.34 Copyright (c) 1999-2006 Igor Pavlov 2006-02-23\n");
fprintf(stderr, "\nLZMA 4.35 Copyright (c) 1999-2006 Igor Pavlov 2006-03-03\n");
if (n == 1)
{

View File

@@ -287,7 +287,10 @@ STDMETHODIMP CDecoder::CodeReal(ISequentialInStream *inStream,
}
else
return S_FALSE;
CopyBackBlockOp(distance, length);
m_RepDists[m_RepDistPtr++ & 3] = distance;
m_LastLength = length;
if (!m_OutWindowStream.CopyBlock(distance, length))
return S_FALSE;
pos += length;
}
}

View File

@@ -56,16 +56,6 @@ class CDecoder :
void InitStructures();
bool ReadTables();
bool ReadLastTables();
void CopyBackBlockOp(UInt32 aDistance, UInt32 aLength)
{
/*
if(m_Position <= aDistance)
throw CDecoderException(CDecoderException::kData);
*/
m_RepDists[m_RepDistPtr++ & 3] = aDistance;
m_LastLength = aLength;
m_OutWindowStream.CopyBlock(aDistance, aLength);
}
public:
CDecoder();