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:
authorIgor Pavlov <ipavlov@users.sourceforge.net>2016-05-20 03:00:00 +0300
committerKornel LesiƄski <kornel@geekhood.net>2016-05-28 02:16:59 +0300
commitbec3b479dcae1345a466ebe923989b0bd56fd5b6 (patch)
tree048b53858db838682f169140ba9887fdf819ab2e /CPP/7zip/Archive/Zip
parent66ac98bb02ac0fadd2a0e3266ea39279984580a3 (diff)
16.0116.01
Diffstat (limited to 'CPP/7zip/Archive/Zip')
-rw-r--r--CPP/7zip/Archive/Zip/ZipIn.cpp25
-rw-r--r--CPP/7zip/Archive/Zip/ZipUpdate.cpp16
2 files changed, 24 insertions, 17 deletions
diff --git a/CPP/7zip/Archive/Zip/ZipIn.cpp b/CPP/7zip/Archive/Zip/ZipIn.cpp
index fe5200f7..c71c40fd 100644
--- a/CPP/7zip/Archive/Zip/ZipIn.cpp
+++ b/CPP/7zip/Archive/Zip/ZipIn.cpp
@@ -297,11 +297,14 @@ HRESULT CInArchive::FindMarker(IInStream *stream, const UInt64 *searchLimit)
if (searchLimit && *searchLimit == 0)
{
Byte startBuf[kMarkerSize];
- size_t processed = kMarkerSize;
- RINOK(ReadStream(stream, startBuf, &processed));
- m_Position += processed;
- if (processed < kMarkerSize)
- return S_FALSE;
+ {
+ size_t processed = kMarkerSize;
+ RINOK(ReadStream(stream, startBuf, &processed));
+ m_Position += processed;
+ if (processed != kMarkerSize)
+ return S_FALSE;
+ }
+
m_Signature = Get32(startBuf);
if (m_Signature != NSignature::kEcd &&
@@ -318,7 +321,7 @@ HRESULT CInArchive::FindMarker(IInStream *stream, const UInt64 *searchLimit)
size_t processed = kMarkerSize;
RINOK(ReadStream(stream, startBuf, &processed));
m_Position += processed;
- if (processed < kMarkerSize)
+ if (processed != kMarkerSize)
return S_FALSE;
m_Signature = Get32(startBuf);
if (m_Signature != NSignature::kEcd &&
@@ -1567,7 +1570,7 @@ HRESULT CInArchive::ReadVols()
if (Vols.StartIsZip)
Vols.ZipStream = StartStream;
- bool cdOK = false;
+ // bool cdOK = false;
if (Vols.ZipStream)
{
@@ -1589,12 +1592,16 @@ HRESULT CInArchive::ReadVols()
// Vols.EndVolIndex = ecd.ThisDisk;
unsigned numMissingVols;
if (cdDisk == zipDisk)
- cdOK = true;
+ {
+ // cdOK = true;
+ }
else
{
RINOK(ReadVols2(volCallback, cdDisk, zipDisk, zipDisk, 0, numMissingVols));
if (numMissingVols == 0)
- cdOK = false;
+ {
+ // cdOK = false;
+ }
}
}
else if (res != S_FALSE)
diff --git a/CPP/7zip/Archive/Zip/ZipUpdate.cpp b/CPP/7zip/Archive/Zip/ZipUpdate.cpp
index 1546a2af..8cb123e6 100644
--- a/CPP/7zip/Archive/Zip/ZipUpdate.cpp
+++ b/CPP/7zip/Archive/Zip/ZipUpdate.cpp
@@ -596,6 +596,7 @@ static HRESULT Update2(
UInt64 numBytesToCompress = 0;
unsigned i;
+
for (i = 0; i < updateItems.Size(); i++)
{
const CUpdateItem &ui = updateItems[i];
@@ -731,7 +732,6 @@ static HRESULT Update2(
for (i = 0; i < updateItems.Size(); i++)
refs.Refs.Add(CMemBlocks2());
- UInt32 i;
for (i = 0; i < numThreads; i++)
threads.Threads.Add(CThreadInfo(options2));
@@ -804,9 +804,9 @@ static HRESULT Update2(
RINOK(updateCallback->SetOperationResult(NArchive::NUpdate::NOperationResult::kOK));
}
- for (UInt32 i = 0; i < numThreads; i++)
+ for (UInt32 k = 0; k < numThreads; k++)
{
- CThreadInfo &threadInfo = threads.Threads[i];
+ CThreadInfo &threadInfo = threads.Threads[k];
if (threadInfo.IsFree)
{
threadInfo.IsFree = false;
@@ -822,7 +822,7 @@ static HRESULT Update2(
threadInfo.UpdateIndex = mtItemIndex - 1;
compressingCompletedEvents.Add(threadInfo.CompressionCompletedEvent);
- threadIndices.Add(i);
+ threadIndices.Add(k);
break;
}
}
@@ -927,10 +927,10 @@ static HRESULT Update2(
}
else
{
- CMemBlocks2 &memRef = refs.Refs[threadInfo.UpdateIndex];
- threadInfo.OutStreamSpec->DetachData(memRef);
- memRef.CompressingResult = threadInfo.CompressingResult;
- memRef.Defined = true;
+ CMemBlocks2 &memRef2 = refs.Refs[threadInfo.UpdateIndex];
+ threadInfo.OutStreamSpec->DetachData(memRef2);
+ memRef2.CompressingResult = threadInfo.CompressingResult;
+ memRef2.Defined = true;
continue;
}
}