diff options
| author | Connor McLaughlin <stenzek@gmail.com> | 2019-08-09 22:16:33 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-09 22:16:33 +1000 |
| commit | e87a3f91a919fa0a470b5f785b354661dcb1f4d4 (patch) | |
| tree | a828499987fb9cc84f3565738eef18ce2dc4986c /Source/Core/DiscIO/DiscScrubber.cpp | |
| parent | 2df522d4eb27961dc10c3423f52277f5d3a84234 (diff) | |
| parent | 107291dc5aef04ecd8465f533ed8a43fb7acab7a (diff) | |
Merge pull request #8303 from JosJuice/volumeverifier-very-small
Fix problems with running VolumeVerifier on very small disc images
Diffstat (limited to 'Source/Core/DiscIO/DiscScrubber.cpp')
| -rw-r--r-- | Source/Core/DiscIO/DiscScrubber.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/Core/DiscIO/DiscScrubber.cpp b/Source/Core/DiscIO/DiscScrubber.cpp index 0c944a782a..121f5dbe25 100644 --- a/Source/Core/DiscIO/DiscScrubber.cpp +++ b/Source/Core/DiscIO/DiscScrubber.cpp @@ -44,7 +44,8 @@ bool DiscScrubber::SetupScrub(const Volume* disc, int block_size) m_file_size = m_disc->GetSize(); - const size_t num_clusters = static_cast<size_t>(m_file_size / CLUSTER_SIZE); + // Round up when diving by CLUSTER_SIZE, otherwise MarkAsUsed might write out of bounds + const size_t num_clusters = static_cast<size_t>((m_file_size + CLUSTER_SIZE - 1) / CLUSTER_SIZE); // Warn if not DVD5 or DVD9 size if (num_clusters != 0x23048 && num_clusters != 0x46090) |
