summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/VolumeVerifier.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2020-01-22 19:06:09 +0100
committerJosJuice <josjuice@gmail.com>2020-02-02 17:09:58 +0100
commite449d23929611d14e4a726606f00a851d4defdec (patch)
tree347bc7cb6f665a5cf01330b874f12f775cef1e4e /Source/Core/DiscIO/VolumeVerifier.cpp
parentf8f9dbdec3505515e78972bdd26474ae17b1d2d7 (diff)
VolumeVerifier: Don't show an assert for files that are too small
Diffstat (limited to 'Source/Core/DiscIO/VolumeVerifier.cpp')
-rw-r--r--Source/Core/DiscIO/VolumeVerifier.cpp39
1 files changed, 22 insertions, 17 deletions
diff --git a/Source/Core/DiscIO/VolumeVerifier.cpp b/Source/Core/DiscIO/VolumeVerifier.cpp
index b868861fd1..a6040c4a3b 100644
--- a/Source/Core/DiscIO/VolumeVerifier.cpp
+++ b/Source/Core/DiscIO/VolumeVerifier.cpp
@@ -1238,9 +1238,6 @@ void VolumeVerifier::Finish()
WaitForAsyncOperations();
- ASSERT(m_content_index == m_content_offsets.size());
- ASSERT(m_block_index == m_blocks.size());
-
if (m_calculating_any_hash)
{
if (m_hashes_to_calculate.crc32)
@@ -1267,25 +1264,33 @@ void VolumeVerifier::Finish()
if (m_read_errors_occurred)
AddProblem(Severity::Medium, Common::GetStringT("Some of the data could not be read."));
+ bool file_too_small = false;
+
+ if (m_content_index != m_content_offsets.size() || m_block_index != m_blocks.size())
+ file_too_small = true;
+
if (IsDisc(m_volume.GetVolumeType()) &&
(m_volume.IsSizeAccurate() || m_volume.SupportsIntegrityCheck()))
{
u64 volume_size = m_volume.IsSizeAccurate() ? m_volume.GetSize() : m_biggest_verified_offset;
if (m_biggest_referenced_offset > volume_size)
- {
- const bool second_layer_missing =
- m_biggest_referenced_offset > SL_DVD_SIZE && m_volume.GetSize() >= SL_DVD_SIZE;
- std::string text =
- second_layer_missing ?
- Common::GetStringT("This disc image is too small and lacks some data. The problem is "
- "most likely that this is a dual-layer disc that has been dumped "
- "as a single-layer disc.") :
- Common::GetStringT("This disc image is too small and lacks some data. If your "
- "dumping program saved the disc image as several parts, you need "
- "to merge them into one file.");
- AddProblem(Severity::High, std::move(text));
- return;
- }
+ file_too_small = true;
+ }
+
+ if (file_too_small)
+ {
+ const bool second_layer_missing =
+ m_biggest_referenced_offset > SL_DVD_SIZE && m_volume.GetSize() >= SL_DVD_SIZE;
+ std::string text =
+ second_layer_missing ?
+ Common::GetStringT("This disc image is too small and lacks some data. The problem is "
+ "most likely that this is a dual-layer disc that has been dumped "
+ "as a single-layer disc.") :
+ Common::GetStringT("This disc image is too small and lacks some data. If your "
+ "dumping program saved the disc image as several parts, you need "
+ "to merge them into one file.");
+ AddProblem(Severity::High, std::move(text));
+ return;
}
for (auto [partition, blocks] : m_block_errors)