From bbacefeb7592cad86728b6e01e7edf0013543653 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Tue, 6 Aug 2019 21:17:40 +0200 Subject: [PATCH] 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. --- Source/Core/DiscIO/VolumeVerifier.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Core/DiscIO/VolumeVerifier.cpp b/Source/Core/DiscIO/VolumeVerifier.cpp index 275f351908..3ca2f1e2a3 100644 --- a/Source/Core/DiscIO/VolumeVerifier.cpp +++ b/Source/Core/DiscIO/VolumeVerifier.cpp @@ -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)