diff options
| author | Léo Lam <leo@leolam.fr> | 2020-02-09 15:48:57 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-09 15:48:57 +0100 |
| commit | fb0f5437774c356f19c7e8f49c70dbfb295a5dde (patch) | |
| tree | a71b25f50844bfac4e65ffae07aa0501bd4f17c3 /Source/Core/DiscIO/VolumeVerifier.cpp | |
| parent | 5ab846ad121d2da5e0df1e7c29f32f01afcefe6d (diff) | |
| parent | f8355d0f8276eed482a1bd2b9f18fc36b7c33299 (diff) | |
Merge pull request #8574 from JosJuice/volumeverifier-assert-small-file
VolumeVerifier: Improve the messages shown for files that are too small
Diffstat (limited to 'Source/Core/DiscIO/VolumeVerifier.cpp')
| -rw-r--r-- | Source/Core/DiscIO/VolumeVerifier.cpp | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/Source/Core/DiscIO/VolumeVerifier.cpp b/Source/Core/DiscIO/VolumeVerifier.cpp index b868861fd1..c0a33372db 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,32 @@ 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)); } for (auto [partition, blocks] : m_block_errors) |
