summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/WIACompression.cpp
diff options
context:
space:
mode:
authorLC <mathew1800@gmail.com>2020-07-11 11:53:47 -0400
committerGitHub <noreply@github.com>2020-07-11 11:53:47 -0400
commit41a570c74e6615097354947471e789751b4088d9 (patch)
tree6da1fd29253a51f7c26b0d02f2a24d825f0555be /Source/Core/DiscIO/WIACompression.cpp
parent5286fb26575d2153089ba54f1765dd39d8a4b6d2 (diff)
parentf7c32bc04e2a410447fdf431ea838b7bfa84ff4f (diff)
Merge pull request #8947 from JosJuice/rvz-split-seed-read
RVZ: Fix split seed reads
Diffstat (limited to 'Source/Core/DiscIO/WIACompression.cpp')
-rw-r--r--Source/Core/DiscIO/WIACompression.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/Source/Core/DiscIO/WIACompression.cpp b/Source/Core/DiscIO/WIACompression.cpp
index d6d3acae2b..20d19c4877 100644
--- a/Source/Core/DiscIO/WIACompression.cpp
+++ b/Source/Core/DiscIO/WIACompression.cpp
@@ -350,13 +350,11 @@ bool RVZPackDecompressor::Decompress(const DecompressionBuffer& in, Decompressio
if (result)
return *result;
- m_size = Common::swap32(m_decompressed.data.data() + m_decompressed_bytes_read);
+ const u32 size = Common::swap32(m_decompressed.data.data() + m_decompressed_bytes_read);
- m_junk = m_size & 0x80000000;
+ m_junk = size & 0x80000000;
if (m_junk)
{
- m_size &= 0x7FFFFFFF;
-
constexpr size_t SEED_SIZE = LaggedFibonacciGenerator::SEED_SIZE * sizeof(u32);
constexpr size_t BLOCK_SIZE = 0x8000;
@@ -372,6 +370,7 @@ bool RVZPackDecompressor::Decompress(const DecompressionBuffer& in, Decompressio
}
m_decompressed_bytes_read += sizeof(u32);
+ m_size = size & 0x7FFFFFFF;
}
size_t bytes_to_write = std::min<size_t>(m_size, out->data.size() - out->bytes_written);