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>2014-12-07 03:00:00 +0300
committerKornel LesiƄski <kornel@geekhood.net>2016-05-28 02:16:53 +0300
commit0dc16c691d208c904468ba4a2779bbe3a2b4dc4b (patch)
treee6c76818cdba9cfa21764d81abfc960b580b1f0b /CPP/7zip/Archive
parentf08f4dcc3c02464c17753b3feafcfe5243b9e236 (diff)
9.359.35
Diffstat (limited to 'CPP/7zip/Archive')
-rw-r--r--CPP/7zip/Archive/7z/7zHandler.cpp20
-rw-r--r--CPP/7zip/Archive/Iso/IsoHandler.cpp2
-rw-r--r--CPP/7zip/Archive/Zip/ZipUpdate.cpp5
3 files changed, 20 insertions, 7 deletions
diff --git a/CPP/7zip/Archive/7z/7zHandler.cpp b/CPP/7zip/Archive/7z/7zHandler.cpp
index 82983419..af673a73 100644
--- a/CPP/7zip/Archive/7z/7zHandler.cpp
+++ b/CPP/7zip/Archive/7z/7zHandler.cpp
@@ -321,11 +321,16 @@ STDMETHODIMP CHandler::GetRawProp(UInt32 index, PROPID propID, const void **data
if (/* _db.IsTree && propID == kpidName ||
!_db.IsTree && */ propID == kpidPath)
{
- *data = (void *)_db.GetName(index);
- if (*data)
+ const wchar_t *name = _db.GetName(index);
+ if (name)
{
- *dataSize = (UInt32)((_db.NameOffsets[index + 1] - _db.NameOffsets[index]) * 2);
- *propType = NPropDataType::kUtf16z;
+ size_t size = (_db.NameOffsets[index + 1] - _db.NameOffsets[index]) * 2;
+ if (size < ((UInt32)1 << 31))
+ {
+ *data = (void *)name;
+ *dataSize = (UInt32)size;
+ *propType = NPropDataType::kUtf16z;
+ }
}
return S_OK;
}
@@ -382,6 +387,13 @@ HRESULT CHandler::SetMethodToProp(CNum folderIndex, PROPVARIANT *prop) const
for (unsigned j = 0; j < idSize; j++)
id64 = ((id64 << 8) | longID[j]);
inByte.SkipDataNoCheck(idSize);
+
+ if ((mainByte & 0x10) != 0)
+ {
+ inByte.ReadNum(); // NumInStreams
+ inByte.ReadNum(); // NumOutStreams
+ }
+
CNum propsSize = 0;
const Byte *props = NULL;
if ((mainByte & 0x20) != 0)
diff --git a/CPP/7zip/Archive/Iso/IsoHandler.cpp b/CPP/7zip/Archive/Iso/IsoHandler.cpp
index fc984048..eaa94bd8 100644
--- a/CPP/7zip/Archive/Iso/IsoHandler.cpp
+++ b/CPP/7zip/Archive/Iso/IsoHandler.cpp
@@ -322,7 +322,7 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
if (e != 0)
lps->InSize = lps->OutSize = currentTotalSize + offset;
const CDir &item2 = ref.Dir->_subItems[ref.Index + e];
- RINOK(_stream->Seek(item2.ExtentLocation * _archive.BlockSize, STREAM_SEEK_SET, NULL));
+ RINOK(_stream->Seek((UInt64)item2.ExtentLocation * _archive.BlockSize, STREAM_SEEK_SET, NULL));
streamSpec->Init(item2.Size);
RINOK(copyCoder->Code(inStream, realOutStream, NULL, NULL, progress));
if (copyCoderSpec->TotalSize != item2.Size)
diff --git a/CPP/7zip/Archive/Zip/ZipUpdate.cpp b/CPP/7zip/Archive/Zip/ZipUpdate.cpp
index 2978e387..97cce5ac 100644
--- a/CPP/7zip/Archive/Zip/ZipUpdate.cpp
+++ b/CPP/7zip/Archive/Zip/ZipUpdate.cpp
@@ -534,13 +534,14 @@ static HRESULT Update2(
#ifndef _7ZIP_ST
- const size_t kNumMaxThreads = (1 << 10);
UInt32 numThreads = options->NumThreads;
+ const UInt32 kNumMaxThreads = 64;
if (numThreads > kNumMaxThreads)
numThreads = kNumMaxThreads;
+ if (numThreads > MAXIMUM_WAIT_OBJECTS) // is 64 in Windows (is it 64 in all versions?)
+ numThreads = MAXIMUM_WAIT_OBJECTS;
if (numThreads < 1)
numThreads = 1;
-
const size_t kMemPerThread = (1 << 25);
const size_t kBlockSize = 1 << 16;