diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-03-16 15:11:08 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-03-16 14:56:50 +0100 |
commit | ea5f83616e8045ab66fb71994e1cdbcc0efbc326 (patch) | |
tree | f2174863306e4e04467aa6e5d445a4c53f1d6553 /Userland/Libraries/LibCompress/Deflate.cpp | |
parent | c684af1f83c7a5b8d18ce41d5df589718720cec6 (diff) | |
download | serenity-ea5f83616e8045ab66fb71994e1cdbcc0efbc326.zip |
LibCompress+AK: Dont short-circuit error handling propagation
In the case that both the stream and the wrapped substream had errors
to be handled only one of the two would be resolved due to boolean
short circuiting. this commit ensures both are handled irregardless
of one another.
Diffstat (limited to 'Userland/Libraries/LibCompress/Deflate.cpp')
-rw-r--r-- | Userland/Libraries/LibCompress/Deflate.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Libraries/LibCompress/Deflate.cpp b/Userland/Libraries/LibCompress/Deflate.cpp index 654c2584df..bee132ee2a 100644 --- a/Userland/Libraries/LibCompress/Deflate.cpp +++ b/Userland/Libraries/LibCompress/Deflate.cpp @@ -323,7 +323,8 @@ bool DeflateDecompressor::unreliable_eof() const { return m_state == State::Idle bool DeflateDecompressor::handle_any_error() { - return m_input_stream.handle_any_error() || Stream::handle_any_error(); + bool handled_errors = m_input_stream.handle_any_error(); + return Stream::handle_any_error() || handled_errors; } Optional<ByteBuffer> DeflateDecompressor::decompress_all(ReadonlyBytes bytes) |