mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-05-16 23:11:42 +00:00
fix: make sure ipak reading stops in time
This commit is contained in:
@@ -182,11 +182,11 @@ bool IPakEntryReadStream::AdjustChunkBufferWindowForBlockHeader(const IPakDataBl
|
|||||||
|
|
||||||
bool IPakEntryReadStream::NextBlock()
|
bool IPakEntryReadStream::NextBlock()
|
||||||
{
|
{
|
||||||
|
m_pos = AlignForward<int64_t>(m_pos, sizeof(IPakDataBlockHeader));
|
||||||
|
|
||||||
if (m_pos >= m_end_pos)
|
if (m_pos >= m_end_pos)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_pos = AlignForward<int64_t>(m_pos, sizeof(IPakDataBlockHeader));
|
|
||||||
|
|
||||||
const auto chunkStartPos = AlignBackwards<int64_t>(m_pos, IPAK_CHUNK_SIZE);
|
const auto chunkStartPos = AlignBackwards<int64_t>(m_pos, IPAK_CHUNK_SIZE);
|
||||||
const auto blockOffsetInChunk = static_cast<size_t>(m_pos - chunkStartPos);
|
const auto blockOffsetInChunk = static_cast<size_t>(m_pos - chunkStartPos);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user