SquashfsHandler.cpp (p7zip_15.14.1_src_all) | : | SquashfsHandler.cpp (p7zip_16.02_src_all) | ||
---|---|---|---|---|
skipping to change at line 298 | skipping to change at line 298 | |||
bool ThereAreFrags() const { return Frag != kFrag_Empty; } | bool ThereAreFrags() const { return Frag != kFrag_Empty; } | |||
UInt64 GetNumBlocks(const CHeader &_h) const | UInt64 GetNumBlocks(const CHeader &_h) const | |||
{ | { | |||
return (FileSize >> _h.BlockSizeLog) + | return (FileSize >> _h.BlockSizeLog) + | |||
(!ThereAreFrags() && (FileSize & (_h.BlockSize - 1)) != 0); | (!ThereAreFrags() && (FileSize & (_h.BlockSize - 1)) != 0); | |||
} | } | |||
}; | }; | |||
UInt32 CNode::Parse1(const Byte *p, UInt32 size, const CHeader &_h) | UInt32 CNode::Parse1(const Byte *p, UInt32 size, const CHeader &_h) | |||
{ | { | |||
bool be = _h.be; | const bool be = _h.be; | |||
if (size < 4) | if (size < 4) | |||
return 0; | return 0; | |||
UInt16 t = Get16(p); | ||||
if (be) | ||||
{ | { | |||
Type = (UInt16)(t >> 12); | const UInt32 t = Get16(p); | |||
Mode = (UInt16)(t & 0xFFF); | if (be) | |||
Uid = (UInt16)(p[2] >> 4); | { | |||
Gid = (UInt16)(p[2] & 0xF); | Type = (UInt16)(t >> 12); | |||
} | Mode = (UInt16)(t & 0xFFF); | |||
else | Uid = (UInt16)(p[2] >> 4); | |||
{ | Gid = (UInt16)(p[2] & 0xF); | |||
Type = (UInt16)(t & 0xF); | } | |||
Mode = (UInt16)(t >> 4); | else | |||
Uid = (UInt16)(p[2] & 0xF); | { | |||
Gid = (UInt16)(p[2] >> 4); | Type = (UInt16)(t & 0xF); | |||
Mode = (UInt16)(t >> 4); | ||||
Uid = (UInt16)(p[2] & 0xF); | ||||
Gid = (UInt16)(p[2] >> 4); | ||||
} | ||||
} | } | |||
// Xattr = kXattr_Empty; | // Xattr = kXattr_Empty; | |||
// MTime = 0; | // MTime = 0; | |||
FileSize = 0; | FileSize = 0; | |||
StartBlock = 0; | StartBlock = 0; | |||
Frag = kFrag_Empty; | Frag = kFrag_Empty; | |||
if (Type == 0) | if (Type == 0) | |||
{ | { | |||
skipping to change at line 404 | skipping to change at line 406 | |||
// GET_32 (3, RDev); | // GET_32 (3, RDev); | |||
return 5; | return 5; | |||
} | } | |||
UInt32 CNode::Parse2(const Byte *p, UInt32 size, const CHeader &_h) | UInt32 CNode::Parse2(const Byte *p, UInt32 size, const CHeader &_h) | |||
{ | { | |||
bool be = _h.be; | bool be = _h.be; | |||
if (size < 4) | if (size < 4) | |||
return 0; | return 0; | |||
UInt16 t = Get16(p); | ||||
if (be) | ||||
{ | ||||
Type = (UInt16)(t >> 12); | ||||
Mode = (UInt16)(t & 0xFFF); | ||||
} | ||||
else | ||||
{ | { | |||
Type = (UInt16)(t & 0xF); | const UInt32 t = Get16(p); | |||
Mode = (UInt16)(t >> 4); | if (be) | |||
{ | ||||
Type = (UInt16)(t >> 12); | ||||
Mode = (UInt16)(t & 0xFFF); | ||||
} | ||||
else | ||||
{ | ||||
Type = (UInt16)(t & 0xF); | ||||
Mode = (UInt16)(t >> 4); | ||||
} | ||||
} | } | |||
Uid = p[2]; | Uid = p[2]; | |||
Gid = p[3]; | Gid = p[3]; | |||
// Xattr = kXattr_Empty; | // Xattr = kXattr_Empty; | |||
if (Type == kType_FILE) | if (Type == kType_FILE) | |||
{ | { | |||
if (size < 24) | if (size < 24) | |||
return 0; | return 0; | |||
// GET_32 (4, MTime); | // GET_32 (4, MTime); | |||
skipping to change at line 534 | skipping to change at line 539 | |||
} | } | |||
return 0; | return 0; | |||
} | } | |||
UInt32 CNode::Parse3(const Byte *p, UInt32 size, const CHeader &_h) | UInt32 CNode::Parse3(const Byte *p, UInt32 size, const CHeader &_h) | |||
{ | { | |||
bool be = _h.be; | bool be = _h.be; | |||
if (size < 12) | if (size < 12) | |||
return 0; | return 0; | |||
UInt16 t = Get16(p); | ||||
if (be) | ||||
{ | ||||
Type = (UInt16)(t >> 12); | ||||
Mode = (UInt16)(t & 0xFFF); | ||||
} | ||||
else | ||||
{ | { | |||
Type = (UInt16)(t & 0xF); | const UInt32 t = Get16(p); | |||
Mode = (UInt16)(t >> 4); | if (be) | |||
{ | ||||
Type = (UInt16)(t >> 12); | ||||
Mode = (UInt16)(t & 0xFFF); | ||||
} | ||||
else | ||||
{ | ||||
Type = (UInt16)(t & 0xF); | ||||
Mode = (UInt16)(t >> 4); | ||||
} | ||||
} | } | |||
Uid = p[2]; | Uid = p[2]; | |||
Gid = p[3]; | Gid = p[3]; | |||
// GET_32 (4, MTime); | // GET_32 (4, MTime); | |||
// GET_32 (8, Number); | // GET_32 (8, Number); | |||
// Xattr = kXattr_Empty; | // Xattr = kXattr_Empty; | |||
FileSize = 0; | FileSize = 0; | |||
StartBlock = 0; | StartBlock = 0; | |||
if (Type == kType_FILE || Type == kType_FILE + 7) | if (Type == kType_FILE || Type == kType_FILE + 7) | |||
{ | { | |||
skipping to change at line 2116 | skipping to change at line 2125 | |||
if (hres == S_FALSE || !inSeqStream) | if (hres == S_FALSE || !inSeqStream) | |||
{ | { | |||
if (hres == E_OUTOFMEMORY) | if (hres == E_OUTOFMEMORY) | |||
return hres; | return hres; | |||
res = NExtract::NOperationResult::kUnsupportedMethod; | res = NExtract::NOperationResult::kUnsupportedMethod; | |||
} | } | |||
else | else | |||
{ | { | |||
RINOK(hres); | RINOK(hres); | |||
{ | { | |||
HRESULT hres = copyCoder->Code(inSeqStream, outStream, NULL, NULL, pro gress); | hres = copyCoder->Code(inSeqStream, outStream, NULL, NULL, progress); | |||
if (hres == S_OK) | if (hres == S_OK) | |||
{ | { | |||
if (copyCoderSpec->TotalSize == unpackSize) | if (copyCoderSpec->TotalSize == unpackSize) | |||
res = NExtract::NOperationResult::kOK; | res = NExtract::NOperationResult::kOK; | |||
} | } | |||
else if (hres == E_NOTIMPL) | else if (hres == E_NOTIMPL) | |||
{ | { | |||
res = NExtract::NOperationResult::kUnsupportedMethod; | res = NExtract::NOperationResult::kUnsupportedMethod; | |||
} | } | |||
else if (hres != S_FALSE) | else if (hres != S_FALSE) | |||
End of changes. 10 change blocks. | ||||
33 lines changed or deleted | 42 lines changed or added |