mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 15:01:28 +12:00
Savestates/TAR: Fix huge files handling in TAR serialization
This commit is contained in:
parent
4a8beb8588
commit
6214d0c9a5
1 changed files with 3 additions and 2 deletions
|
@ -455,8 +455,9 @@ void tar_object::save_directory(const std::string& target_path, utils::serial& a
|
||||||
const usz read_size = std::min<usz>(transfer_block_size, file_stat.size - read_index);
|
const usz read_size = std::min<usz>(transfer_block_size, file_stat.size - read_index);
|
||||||
|
|
||||||
// Read file data
|
// Read file data
|
||||||
ar.data.resize(ar.data.size() + read_size);
|
const usz buffer_tail = ar.data.size();
|
||||||
ensure(fd.read_at(read_index, ar.data.data() + old_size, read_size) == read_size);
|
ar.data.resize(buffer_tail + read_size);
|
||||||
|
ensure(fd.read_at(read_index, ar.data.data() + buffer_tail, read_size) == read_size);
|
||||||
|
|
||||||
// Set position to the end of data, so breathe() would work correctly
|
// Set position to the end of data, so breathe() would work correctly
|
||||||
ar.seek_end();
|
ar.seek_end();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue