mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-12 14:46:49 +01:00
DiscIO: Fix decompressing writing too little sometimes
This issue cannot happen with good dumps due to their size, but it can happen with trimmed dumps.
This commit is contained in:
parent
d8d620ef0e
commit
26b21e3186
@ -372,6 +372,8 @@ bool DecompressBlobToFile(const std::string& infile_path, const std::string& out
|
|||||||
static const size_t BUFFER_BLOCKS = 32;
|
static const size_t BUFFER_BLOCKS = 32;
|
||||||
size_t buffer_size = header.block_size * BUFFER_BLOCKS;
|
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.block_size * (header.num_blocks % BUFFER_BLOCKS);
|
||||||
|
if (last_buffer_size == 0)
|
||||||
|
last_buffer_size = buffer_size;
|
||||||
std::vector<u8> buffer(buffer_size);
|
std::vector<u8> buffer(buffer_size);
|
||||||
u32 num_buffers = (header.num_blocks + BUFFER_BLOCKS - 1) / BUFFER_BLOCKS;
|
u32 num_buffers = (header.num_blocks + BUFFER_BLOCKS - 1) / BUFFER_BLOCKS;
|
||||||
int progress_monitor = std::max<int>(1, num_buffers / 100);
|
int progress_monitor = std::max<int>(1, num_buffers / 100);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user