"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "CPP/7zip/Archive/CramfsHandler.cpp" between
p7zip_15.14.1_src_all.tar.gz and p7zip_16.02_src_all.tar.gz

About: p7zip is a command-line file archiver with a high compression ratio (a port of the Windows program 7za.exe).

CramfsHandler.cpp  (p7zip_15.14.1_src_all):CramfsHandler.cpp  (p7zip_16.02_src_all)
skipping to change at line 586 skipping to change at line 586
} }
else else
{ {
if (_method != k_Flags_Method_LZMA) if (_method != k_Flags_Method_LZMA)
{ {
// probably we must support no-compression archives here. // probably we must support no-compression archives here.
return E_NOTIMPL; return E_NOTIMPL;
} }
} }
bool be = _h.be; const bool be = _h.be;
const Byte *p = _data + (_curBlocksOffset + (UInt32)blockIndex * 4); const Byte *p2 = _data + (_curBlocksOffset + (UInt32)blockIndex * 4);
UInt32 start = (blockIndex == 0 ? _curBlocksOffset + _curNumBlocks * 4: Get32( const UInt32 start = (blockIndex == 0 ? _curBlocksOffset + _curNumBlocks * 4:
p - 4)); Get32(p2 - 4));
UInt32 end = Get32(p); const UInt32 end = Get32(p2);
if (end < start || end > _size) if (end < start || end > _size)
return S_FALSE; return S_FALSE;
UInt32 inSize = end - start; const UInt32 inSize = end - start;
if (_method == k_Flags_Method_LZMA) if (_method == k_Flags_Method_LZMA)
{ {
const unsigned kLzmaHeaderSize = LZMA_PROPS_SIZE + 4; const unsigned kLzmaHeaderSize = LZMA_PROPS_SIZE + 4;
if (inSize < kLzmaHeaderSize) if (inSize < kLzmaHeaderSize)
return S_FALSE; return S_FALSE;
const Byte *p = _data + start; const Byte *p = _data + start;
UInt32 destSize32 = GetUi32(p + LZMA_PROPS_SIZE); UInt32 destSize32 = GetUi32(p + LZMA_PROPS_SIZE);
if (destSize32 > blockSize) if (destSize32 > blockSize)
return S_FALSE; return S_FALSE;
skipping to change at line 710 skipping to change at line 710
CMyComPtr<ISequentialInStream> inSeqStream; CMyComPtr<ISequentialInStream> inSeqStream;
HRESULT hres = GetStream(index, &inSeqStream); HRESULT hres = GetStream(index, &inSeqStream);
if (hres == E_OUTOFMEMORY) if (hres == E_OUTOFMEMORY)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
if (hres == S_FALSE || !inSeqStream) if (hres == S_FALSE || !inSeqStream)
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 == curSize) if (copyCoderSpec->TotalSize == curSize)
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)
return hres; return hres;
} }
 End of changes. 3 change blocks. 
7 lines changed or deleted 7 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS