diff options
Diffstat (limited to 'CPP/7zip/Archive/Zip/ZipIn.cpp')
-rwxr-xr-x | CPP/7zip/Archive/Zip/ZipIn.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/CPP/7zip/Archive/Zip/ZipIn.cpp b/CPP/7zip/Archive/Zip/ZipIn.cpp index bb45d1d1..bf3764f7 100755 --- a/CPP/7zip/Archive/Zip/ZipIn.cpp +++ b/CPP/7zip/Archive/Zip/ZipIn.cpp @@ -542,6 +542,10 @@ HRESULT CInArchive::FindCd(CCdInfo &cdInfo) // cdInfo.NumEntries = GetUInt16(buf + i + 10); cdInfo.Size = GetUInt32(buf + i + 12); cdInfo.Offset = GetUInt32(buf + i + 16); + UInt64 curPos = endPosition - bufSize + i; + UInt64 cdEnd = cdInfo.Size + cdInfo.Offset; + if (curPos > cdEnd) + m_ArchiveInfo.Base = curPos - cdEnd; return S_OK; } } |