"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "CPP/7zip/Archive/Chm/ChmHandler.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).

ChmHandler.cpp  (p7zip_15.14.1_src_all):ChmHandler.cpp  (p7zip_16.02_src_all)
skipping to change at line 157 skipping to change at line 157
if (!item.IsDir()) if (!item.IsDir())
if (item.Section == 0) if (item.Section == 0)
prop = "Copy"; prop = "Copy";
else if (item.Section < m_Database.Sections.Size()) else if (item.Section < m_Database.Sections.Size())
prop = m_Database.Sections[(unsigned)item.Section].GetMethodName(); prop = m_Database.Sections[(unsigned)item.Section].GetMethodName();
break; break;
} }
case kpidBlock: case kpidBlock:
if (m_Database.LowLevel) if (m_Database.LowLevel)
prop = item.Section; prop = item.Section;
else if (item.Section != 0) else if (item.Section != 0 && item.Section < m_Database.Sections.Size())
prop = m_Database.GetFolder(index); prop = m_Database.GetFolder(index);
break; break;
#ifdef _CHM_DETAILS #ifdef _CHM_DETAILS
case kpidSection: prop = (UInt32)item.Section; break; case kpidSection: prop = (UInt32)item.Section; break;
case kpidOffset: prop = (UInt32)item.Offset; break; case kpidOffset: prop = (UInt32)item.Offset; break;
#endif #endif
} }
skipping to change at line 547 skipping to change at line 547
UInt32 index = allFilesMode ? i : indices[i]; UInt32 index = allFilesMode ? i : indices[i];
const CItem &item = m_Database.Items[m_Database.Indices[index]]; const CItem &item = m_Database.Items[m_Database.Indices[index]];
const UInt64 sectionIndex = item.Section; const UInt64 sectionIndex = item.Section;
if (item.IsDir() || item.Size == 0) if (item.IsDir() || item.Size == 0)
continue; continue;
if (sectionIndex == 0) if (sectionIndex == 0)
{ {
currentTotalSize += item.Size; currentTotalSize += item.Size;
continue; continue;
} }
const CSectionInfo &section = m_Database.Sections[(unsigned)item.Section];
if (sectionIndex >= m_Database.Sections.Size())
continue;
const CSectionInfo &section = m_Database.Sections[(unsigned)sectionIndex];
if (section.IsLzx()) if (section.IsLzx())
{ {
const CLzxInfo &lzxInfo = section.Methods[0].LzxInfo; const CLzxInfo &lzxInfo = section.Methods[0].LzxInfo;
UInt64 folderIndex = m_Database.GetFolder(index); UInt64 folderIndex = m_Database.GetFolder(index);
if (lastFolderIndex == folderIndex) if (lastFolderIndex == folderIndex)
folderIndex++; folderIndex++;
lastFolderIndex = m_Database.GetLastFolder(index); lastFolderIndex = m_Database.GetLastFolder(index);
for (; folderIndex <= lastFolderIndex; folderIndex++) for (; folderIndex <= lastFolderIndex; folderIndex++)
currentTotalSize += lzxInfo.GetFolderSize(); currentTotalSize += lzxInfo.GetFolderSize();
} }
skipping to change at line 623 skipping to change at line 627
RINOK(copyCoder->Code(inStream, realOutStream, NULL, NULL, progress)); RINOK(copyCoder->Code(inStream, realOutStream, NULL, NULL, progress));
if (copyCoderSpec->TotalSize != item.Size) if (copyCoderSpec->TotalSize != item.Size)
opRes = NExtract::NOperationResult::kDataError; opRes = NExtract::NOperationResult::kDataError;
} }
realOutStream.Release(); realOutStream.Release();
RINOK(extractCallback->SetOperationResult(opRes)); RINOK(extractCallback->SetOperationResult(opRes));
currentTotalSize += item.Size; currentTotalSize += item.Size;
continue; continue;
} }
if (sectionIndex >= m_Database.Sections.Size())
{
// we must report error here;
CMyComPtr<ISequentialOutStream> realOutStream;
RINOK(extractCallback->GetStream(index, &realOutStream, askMode));
if (!testMode && !realOutStream)
continue;
RINOK(extractCallback->PrepareOperation(askMode));
RINOK(extractCallback->SetOperationResult(NExtract::NOperationResult::kHea
dersError));
continue;
}
const CSectionInfo &section = m_Database.Sections[(unsigned)sectionIndex]; const CSectionInfo &section = m_Database.Sections[(unsigned)sectionIndex];
if (!section.IsLzx()) if (!section.IsLzx())
{ {
CMyComPtr<ISequentialOutStream> realOutStream; CMyComPtr<ISequentialOutStream> realOutStream;
RINOK(extractCallback->GetStream(index, &realOutStream, askMode)); RINOK(extractCallback->GetStream(index, &realOutStream, askMode));
if (!testMode && !realOutStream) if (!testMode && !realOutStream)
continue; continue;
RINOK(extractCallback->PrepareOperation(askMode)); RINOK(extractCallback->PrepareOperation(askMode));
RINOK(extractCallback->SetOperationResult(NExtract::NOperationResult::kUns upportedMethod)); RINOK(extractCallback->SetOperationResult(NExtract::NOperationResult::kUns upportedMethod));
 End of changes. 3 change blocks. 
2 lines changed or deleted 19 lines changed or added

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