Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'CPP/7zip/Archive/Zip/ZipIn.cpp')
-rwxr-xr-xCPP/7zip/Archive/Zip/ZipIn.cpp4
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;
}
}