diff options
| author | JosJuice <josjuice@gmail.com> | 2020-04-12 21:47:10 +0200 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2020-04-12 21:47:10 +0200 |
| commit | 3aa463cdaee872aa220fdc474a6e47584e3f3190 (patch) | |
| tree | 2458d4df2cca175eb4a40af799137190d8a7049e /Source/Core/DiscIO/CompressedBlob.cpp | |
| parent | 26b21e3186386df015b02eb23dacd04f86669d8f (diff) | |
DiscIO: Fix decompressing writing too much sometimes
This issue cannot happen with good dumps due to their size,
but it can happen with trimmed dumps.
Diffstat (limited to 'Source/Core/DiscIO/CompressedBlob.cpp')
| -rw-r--r-- | Source/Core/DiscIO/CompressedBlob.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/Core/DiscIO/CompressedBlob.cpp b/Source/Core/DiscIO/CompressedBlob.cpp index 1fe8c4c921..f1ab226025 100644 --- a/Source/Core/DiscIO/CompressedBlob.cpp +++ b/Source/Core/DiscIO/CompressedBlob.cpp @@ -371,7 +371,7 @@ bool DecompressBlobToFile(const std::string& infile_path, const std::string& out const CompressedBlobHeader& header = reader->GetHeader(); static const size_t BUFFER_BLOCKS = 32; size_t buffer_size = header.block_size * BUFFER_BLOCKS; - size_t last_buffer_size = header.block_size * (header.num_blocks % BUFFER_BLOCKS); + size_t last_buffer_size = header.data_size % buffer_size; if (last_buffer_size == 0) last_buffer_size = buffer_size; std::vector<u8> buffer(buffer_size); |
