mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-19 15:52:53 +00:00
Fix calculating wrong chunk buffer window when only the block header is inside a chunk and all the data is in the next
This commit is contained in:
parent
75cd9bd4e4
commit
4811d41ec8
@ -176,6 +176,11 @@ public:
|
|||||||
void StartNewBlock()
|
void StartNewBlock()
|
||||||
{
|
{
|
||||||
AlignToBlockHeader();
|
AlignToBlockHeader();
|
||||||
|
|
||||||
|
// Skip to the next chunk when only the header could fit into the current chunk anyway
|
||||||
|
if (static_cast<size_t>(utils::Align(m_current_offset, static_cast<int64_t>(ipak_consts::IPAK_CHUNK_SIZE)) - m_current_offset) <= sizeof(IPakDataBlockHeader))
|
||||||
|
FlushChunk();
|
||||||
|
|
||||||
m_current_block_header_offset = m_current_offset;
|
m_current_block_header_offset = m_current_offset;
|
||||||
m_current_block = {};
|
m_current_block = {};
|
||||||
m_current_block.countAndOffset.offset = static_cast<uint32_t>(m_file_offset);
|
m_current_block.countAndOffset.offset = static_cast<uint32_t>(m_file_offset);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user