summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/DiscScrubber.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2022-08-01 11:53:30 +0200
committerJosJuice <josjuice@gmail.com>2022-08-04 22:00:59 +0200
commit40a4eb3893ce3cae8a3edcc6356812fdcb98c1b9 (patch)
treefd53444014d1d36953d5bfaf29c985a4b630c689 /Source/Core/DiscIO/DiscScrubber.cpp
parenta87dffe52d8bfaa05d07770a9113cf9406ea6db0 (diff)
DiscIO: Adjust GetDataSizeType logic for NFS
Diffstat (limited to 'Source/Core/DiscIO/DiscScrubber.cpp')
-rw-r--r--Source/Core/DiscIO/DiscScrubber.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/Core/DiscIO/DiscScrubber.cpp b/Source/Core/DiscIO/DiscScrubber.cpp
index 690af80045..22aa06571e 100644
--- a/Source/Core/DiscIO/DiscScrubber.cpp
+++ b/Source/Core/DiscIO/DiscScrubber.cpp
@@ -47,7 +47,11 @@ bool DiscScrubber::SetupScrub(const Volume* disc)
bool DiscScrubber::CanBlockBeScrubbed(u64 offset) const
{
- return m_is_scrubbing && m_free_table[offset / CLUSTER_SIZE];
+ if (!m_is_scrubbing)
+ return false;
+
+ const u64 cluster_index = offset / CLUSTER_SIZE;
+ return cluster_index >= m_free_table.size() || m_free_table[cluster_index];
}
void DiscScrubber::MarkAsUsed(u64 offset, u64 size)