VolumeVerifier: Handle contents overlapping

This can't actually happen in practice due to how WAD files work,
but it's very easy to add support for thanks to the last commit,
so we might as well add support for it.
This commit is contained in:
JosJuice 2019-08-06 21:17:40 +02:00
parent 10e1acf25c
commit bbacefeb75
1 changed files with 6 additions and 0 deletions

View File

@ -1095,6 +1095,12 @@ void VolumeVerifier::Process()
m_volume.GetTMD(PARTITION_NONE).GetContent(m_content_index, &content);
bytes_to_read = Common::AlignUp(content.size, 0x40);
content_read = true;
if (m_content_index + 1 < m_content_offsets.size() &&
m_content_offsets[m_content_index + 1] < m_progress + bytes_to_read)
{
excess_bytes = m_progress + bytes_to_read - m_content_offsets[m_content_index + 1];
}
}
else if (m_content_index < m_content_offsets.size() &&
m_content_offsets[m_content_index] > m_progress)