mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-05 14:31:24 +12: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)
|
while (true)
|
||||||
{
|
{
|
||||||
// Avoid flooding RAM, wait if there is too much pending memory
|
// 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;
|
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)
|
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);
|
while (m_zs.avail_out == 0 || m_zs.avail_in != 0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue