1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:57:44 +00:00

AK+LibCompress: Break when seekback copying to a full CircularBuffer

Otherwise, we just end up infinitely looping while waiting for more
space in the destination.
This commit is contained in:
Tim Schumacher 2023-04-04 18:43:24 +02:00 committed by Tim Flynn
parent 767fb01a8c
commit b88c58b94c
2 changed files with 7 additions and 1 deletions

View file

@ -208,7 +208,10 @@ ErrorOr<bool> DeflateDecompressor::CompressedBlock::try_read_more()
m_decompressor.m_output_buffer.write({ &byte, sizeof(byte) });
}
} else {
TRY(m_decompressor.m_output_buffer.copy_from_seekback(distance, length));
auto copied_length = TRY(m_decompressor.m_output_buffer.copy_from_seekback(distance, length));
// TODO: What should we do if the output buffer is full?
VERIFY(copied_length == length);
}
return true;