summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/lzma/CPP/7zip/UI/Common/OpenArchive.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2016-11-18 20:35:18 +1100
committer Vas Crabb <vas@vastheman.com>2016-11-18 20:37:20 +1100
commitbb99eba11dadfa37acb2a796f4f8e2b0a7330e44 (patch)
tree4f1f81e691e55d8e7feb47ac5c2dfd8ca0312ce1 /3rdparty/lzma/CPP/7zip/UI/Common/OpenArchive.cpp
parentae4b0cdcf26f610687da38c69dd94ceaba593051 (diff)
Update LZMA to 16.04 (security and portability fixes)
Diffstat (limited to '3rdparty/lzma/CPP/7zip/UI/Common/OpenArchive.cpp')
-rw-r--r--3rdparty/lzma/CPP/7zip/UI/Common/OpenArchive.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/3rdparty/lzma/CPP/7zip/UI/Common/OpenArchive.cpp b/3rdparty/lzma/CPP/7zip/UI/Common/OpenArchive.cpp
index 4081b0a67d4..bf3b982e44e 100644
--- a/3rdparty/lzma/CPP/7zip/UI/Common/OpenArchive.cpp
+++ b/3rdparty/lzma/CPP/7zip/UI/Common/OpenArchive.cpp
@@ -497,7 +497,7 @@ static HRESULT Archive_GetArcProp_UInt(IInArchive *arc, PROPID propid, UInt64 &r
switch (prop.vt)
{
case VT_UI4: result = prop.ulVal; defined = true; break;
- case VT_I4: result = prop.lVal; defined = true; break;
+ case VT_I4: result = (Int64)prop.lVal; defined = true; break;
case VT_UI8: result = (UInt64)prop.uhVal.QuadPart; defined = true; break;
case VT_I8: result = (UInt64)prop.hVal.QuadPart; defined = true; break;
case VT_EMPTY: break;
@@ -582,9 +582,9 @@ HRESULT CArc::GetItemPathToParent(UInt32 index, UInt32 parent, UStringVector &pa
if (prevWasAltStream)
{
{
- UString &s = parts[parts.Size() - 2];
- s += L':';
- s += parts.Back();
+ UString &s2 = parts[parts.Size() - 2];
+ s2 += L':';
+ s2 += parts.Back();
}
parts.DeleteBack();
}
@@ -864,7 +864,7 @@ HRESULT CArc::GetItem(UInt32 index, CReadArcItem &item) const
{
item.MainPath.DeleteFrom(colon);
item.AltStreamName = item.Path.Ptr(colon + 1);
- item.MainIsDir = (colon == 0 || IsPathSepar(item.Path[colon - 1]));
+ item.MainIsDir = (colon == 0 || IsPathSepar(item.Path[(unsigned)colon - 1]));
item.IsAltStream = true;
}
}
@@ -2015,7 +2015,6 @@ HRESULT CArc::OpenStream2(const COpenOptions &op)
const CArcInfoEx &ai = op.codecs->Formats[formatIndex];
if (ai.FindExtension(extension) >= 0)
{
- const CArcInfoEx &ai = op.codecs->Formats[formatIndex];
if (ai.Flags_FindSignature() && searchMarkerInHandler)
return S_FALSE;
}
@@ -3467,6 +3466,8 @@ static bool ParseTypeParams(const UString &s, COpenType &type)
bool ParseType(CCodecs &codecs, const UString &s, COpenType &type)
{
int pos2 = s.Find(L':');
+
+ {
UString name;
if (pos2 < 0)
{
@@ -3501,13 +3502,15 @@ bool ParseType(CCodecs &codecs, const UString &s, COpenType &type)
}
type.FormatIndex = index;
+
+ }
for (unsigned i = pos2; i < s.Len();)
{
int next = s.Find(L':', i);
if (next < 0)
next = s.Len();
- UString name = s.Mid(i, next - i);
+ const UString name = s.Mid(i, next - i);
if (name.IsEmpty())
return false;
if (!ParseTypeParams(name, type))