1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:57:45 +00:00

LibCompress+AK: Propagate error handling to wrapped streams

This ensures that when a DeflateCompressor stream is cleared of any
errors its underlying wrapped streams (InputBitStream/InputMemoryStream)
will be cleared as well and wont fail a VERIFY on destruction.
This commit is contained in:
Idan Horowitz 2021-03-15 17:20:20 +02:00 committed by Andreas Kling
parent f532421c9c
commit a955fd4156
3 changed files with 11 additions and 0 deletions

View file

@ -321,6 +321,11 @@ bool DeflateDecompressor::discard_or_error(size_t count)
bool DeflateDecompressor::unreliable_eof() const { return m_state == State::Idle && m_read_final_bock; }
bool DeflateDecompressor::handle_any_error()
{
return m_input_stream.handle_any_error() || Stream::handle_any_error();
}
Optional<ByteBuffer> DeflateDecompressor::decompress_all(ReadonlyBytes bytes)
{
InputMemoryStream memory_stream { bytes };