mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 19:45:20 +00:00
Compression: Fix infinite loop
Always keep expanding the buffer even if avail_in is 0
This commit is contained in:
parent
b00fe1d12f
commit
847b721558
1 changed files with 2 additions and 2 deletions
|
@ -289,7 +289,7 @@ bool compressed_serialization_file_handler::handle_file_op(utils::serial& ar, us
|
|||
while (true)
|
||||
{
|
||||
// Avoid flooding RAM, wait if there is too much pending memory
|
||||
const usz new_value = m_pending_bytes.atomic_op([&](usz v)
|
||||
const usz new_value = m_pending_bytes.atomic_op([&](usz& v)
|
||||
{
|
||||
v &= ~pending_data_wait_bit;
|
||||
|
||||
|
@ -647,7 +647,7 @@ void compressed_serialization_file_handler::stream_data_prepare_thread_op()
|
|||
|
||||
if (m_zs.avail_out == 0)
|
||||
{
|
||||
m_stream_data.resize(m_stream_data.size() + (m_zs.avail_in + 3ull) / 4);
|
||||
m_stream_data.resize(m_stream_data.size() + (m_zs.avail_in / 4) + (m_stream_data.size() / 16) + 1);
|
||||
}
|
||||
}
|
||||
while (m_zs.avail_out == 0 || m_zs.avail_in != 0);
|
||||
|
|
Loading…
Add table
Reference in a new issue