This commit is contained in:
Igor Pavlov
2016-05-20 00:00:00 +00:00
committed by Kornel Lesiński
parent 66ac98bb02
commit bec3b479dc
88 changed files with 972 additions and 753 deletions

View File

@@ -189,8 +189,8 @@ bool CItem::FindExtra_Version(UInt64 &version) const
return false;
const Byte *p = Extra + (unsigned)offset;
UInt64 Flags;
unsigned num = ReadVarInt(p, size, &Flags);
UInt64 flags;
unsigned num = ReadVarInt(p, size, &flags);
if (num == 0) return false; p += num; size -= num;
num = ReadVarInt(p, size, &version);
@@ -1881,6 +1881,7 @@ HRESULT CHandler::Open2(IInStream *stream,
}
CInArcInfo arcInfoOpen;
{
HRESULT res = arch.Open(inStream, maxCheckStartPosition, getTextPassword, arcInfoOpen);
if (arch.IsArc && arch.UnexpectedEnd)
_errorFlags |= kpv_ErrorFlags_UnexpectedEnd;
@@ -1897,6 +1898,7 @@ HRESULT CHandler::Open2(IInStream *stream,
return res;
break;
}
}
CArc &arc = _arcs.AddNew();
CInArcInfo &arcInfo = arc.Info;
@@ -2068,12 +2070,12 @@ HRESULT CHandler::Open2(IInStream *stream,
{
if (prevSplitFile >= 0)
{
CRefItem &ref = _refs[prevSplitFile];
CItem &prevItem = _items[ref.Last];
CRefItem &ref2 = _refs[prevSplitFile];
CItem &prevItem = _items[ref2.Last];
if (item.IsNextForItem(prevItem))
{
ref.Last = _items.Size();
prevItem.NextItem = ref.Last;
ref2.Last = _items.Size();
prevItem.NextItem = ref2.Last;
needAdd = false;
}
}

View File

@@ -1602,11 +1602,11 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
if (len > kPasswordLen_MAX)
len = kPasswordLen_MAX;
CByteArr buffer(len * 2);
for (unsigned i = 0; i < len; i++)
for (unsigned k = 0; k < len; k++)
{
wchar_t c = password[i];
((Byte *)buffer)[i * 2] = (Byte)c;
((Byte *)buffer)[i * 2 + 1] = (Byte)(c >> 8);
wchar_t c = password[k];
((Byte *)buffer)[k * 2] = (Byte)c;
((Byte *)buffer)[k * 2 + 1] = (Byte)(c >> 8);
}
rar3CryptoDecoderSpec->SetPassword((const Byte *)buffer, len * 2);
}