diff options
| author | ljfa <ljfa-ag@web.de> | 2015-09-21 18:10:03 +0200 |
|---|---|---|
| committer | ljfa <ljfa-ag@web.de> | 2015-09-21 18:10:03 +0200 |
| commit | 8773152a57a4e1524be66c7d6777c48de246040f (patch) | |
| tree | 4820f57edbe07859737624b8dfcdbf91309a8687 /src/io/izlibstream.cpp | |
| parent | 57136429177ed86e2152154d4ecc229d3afe6d94 (diff) | |
| download | Project-Tick-8773152a57a4e1524be66c7d6777c48de246040f.tar.gz Project-Tick-8773152a57a4e1524be66c7d6777c48de246040f.zip | |
Make the inflate_streambuf rewind the input
Diffstat (limited to 'src/io/izlibstream.cpp')
| -rw-r--r-- | src/io/izlibstream.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/io/izlibstream.cpp b/src/io/izlibstream.cpp index 85e04a189a..0a7512469e 100644 --- a/src/io/izlibstream.cpp +++ b/src/io/izlibstream.cpp @@ -78,7 +78,13 @@ inflate_streambuf::int_type inflate_streambuf::underflow() throw std::bad_alloc(); case Z_STREAM_END: - stream_end = true; + if(!stream_end) + { + stream_end = true; + //In case we consumed too much, we have to rewind the input stream + is.clear(); + is.seekg(-static_cast<std::streamoff>(zstr.avail_in), std::ios_base::cur); + } if(have == 0) return traits_type::eof(); break; |
