aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/zlib.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/common/zlib.cpp b/common/zlib.cpp
index 3b51d66a5b..39130beb4e 100644
--- a/common/zlib.cpp
+++ b/common/zlib.cpp
@@ -316,6 +316,7 @@ protected:
ScopedPtr<WriteStream> _wrapped;
z_stream _stream;
int _zlibErr;
+ uint32 _pos;
void processData(int flushType) {
// This function is called by both write() and finalize().
@@ -333,7 +334,7 @@ protected:
}
public:
- GZipWriteStream(WriteStream *w) : _wrapped(w), _stream() {
+ GZipWriteStream(WriteStream *w) : _wrapped(w), _stream(), _pos(0) {
assert(w != 0);
// Adding 16 to windowBits indicates to zlib that it is supposed to
@@ -403,10 +404,11 @@ public:
// ... and flush it to disk
processData(Z_NO_FLUSH);
+ _pos += dataSize - _stream.avail_in;
return dataSize - _stream.avail_in;
}
- virtual int32 pos() const { return _wrapped->pos(); }
+ virtual int32 pos() const { return _pos; }
};
#endif // USE_ZLIB