diff options
| author | Léo Lam <leo@innovatetechnologi.es> | 2018-05-30 10:55:13 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-30 10:55:13 +0200 |
| commit | eb9969a1e290d968b506921936a0d51bf5501607 (patch) | |
| tree | e5314ebedb673ca2da295bdbf6abe08a689f71f5 /Source/Core/DiscIO/VolumeWii.cpp | |
| parent | c3de9d7b0eaa676318678765f6f9849d3caf57f6 (diff) | |
| parent | efabfc0b5481b2f40c13213dfba3a2671eb96b0b (diff) | |
Merge pull request #7025 from lioncash/integrity
VolumeWii: Use ReadSwapped for retrieving the partition data size in CheckIntegrity()
Diffstat (limited to 'Source/Core/DiscIO/VolumeWii.cpp')
| -rw-r--r-- | Source/Core/DiscIO/VolumeWii.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/Core/DiscIO/VolumeWii.cpp b/Source/Core/DiscIO/VolumeWii.cpp index c9960a441f..5d9d4b3983 100644 --- a/Source/Core/DiscIO/VolumeWii.cpp +++ b/Source/Core/DiscIO/VolumeWii.cpp @@ -394,11 +394,11 @@ bool VolumeWii::CheckIntegrity(const Partition& partition) const return false; // Get partition data size - u32 part_size_div4; - m_reader->Read(partition.offset + 0x2BC, sizeof(u32), reinterpret_cast<u8*>(&part_size_div4)); - const u64 part_data_size = static_cast<u64>(Common::swap32(part_size_div4)) * 4; + const auto part_data_size = ReadSwappedAndShifted(partition.offset + 0x2BC, PARTITION_NONE); + if (!part_data_size) + return false; - const u32 num_clusters = static_cast<u32>(part_data_size / 0x8000); + const u32 num_clusters = static_cast<u32>(part_data_size.value() / 0x8000); for (u32 cluster_id = 0; cluster_id < num_clusters; ++cluster_id) { const u64 cluster_offset = |
