summaryrefslogtreecommitdiff
path: root/src/io
diff options
context:
space:
mode:
Diffstat (limited to 'src/io')
-rw-r--r--src/io/izlibstream.cpp8
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;