Subject: [Boost-bugs] [Boost C++ Libraries] #5291: bzip2_decompressor does not work properly with a filtering_streambuf
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-03-11 15:12:04
#5291: bzip2_decompressor does not work properly with a filtering_streambuf
--------------------------------------------------------+-------------------
Reporter: Chris Steenwyk <chris.steenwyk@â¦> | Owner: turkanis
Type: Bugs | Status: new
Milestone: To Be Determined | Component: iostreams
Version: Boost 1.45.0 | Severity: Problem
Keywords: |
--------------------------------------------------------+-------------------
The revision 63057 of boost/iostreams/filter/bzip2.hpp seems to have
broken the ability to use the bzip2 decompressor in a filtering streambuf.
When I pass a stream into the buffer it throws data_error_magic. Stepping
through the code I can see it correctly decode the zipped data, but then
it continues to attempt to decode data even after eof is reached.
Looking at the changes to bzip2_decompressor_impl I see the following
issues:
1.) The function returns true even if _eof is set to true. This causes
the "done" flag in the "Read" function in symmetric.hpp to be set to
false, which causes the bzip2_decompressor_impl function to execute again,
after EOL.
2.) On the second execution when _eof is set, the "close" function resets
_eof to false, which can cause the function to throw the exception.
In the specific instance I am using, my bzip compressed section is
embedded in the middle of the stream, so src_begin won't equal src_end.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5291> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:05 UTC