Subject: [Boost-bugs] [Boost C++ Libraries] #9749: bzip2_decompressor input filter gives data_error_magic
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-03-06 20:11:05
#9749: bzip2_decompressor input filter gives data_error_magic
-------------------------------------------------+-------------------------
Reporter: Balazs Andor Zalanyi | Owner: turkanis
<zalanyi.balazs@â¦> | Status: new
Type: Bugs | Component: iostreams
Milestone: To Be Determined | Severity: Problem
Version: Boost 1.55.0 |
Keywords: bzip2_decompressor |
-------------------------------------------------+-------------------------
The bzip2_decompressor input filter is not able to read some bz2 files
properly. It can read only the first few lines of the file then terminates
with data_error_magic (BZ_DATA_ERROR_MAGIC in bzlib.h).
After examining the problematic bz2 files I noticed that the first
compressed stream is much shorter (536 bytes long) than the following
streams. Debugging lead me to the conclusion that the simmetric_filter
class's read method fills the buffer with new data even when the buffer
hasn't been consumed completely. With the proposed solution below the
files can be read to the end without further problems.
The original code segment:
{{{
if (status == f_good)
status = fill(src);
}}}
The proposed modification:
{{{
if (status == f_good && buf.ptr() == buf.eptr())
status = fill(src);
}}}
Could someone please make this modification?
Regards,
Balazs
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/9749> 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:15 UTC