Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'coding/zlib.hpp')
-rw-r--r--coding/zlib.hpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/coding/zlib.hpp b/coding/zlib.hpp
index ee6775563b..dba1a59ec7 100644
--- a/coding/zlib.hpp
+++ b/coding/zlib.hpp
@@ -118,12 +118,19 @@ private:
while (true)
{
int const flush = processor.ConsumedAll() ? Z_FINISH : Z_NO_FLUSH;
- int const ret = processor.Process(flush);
- if (ret != Z_OK && ret != Z_STREAM_END)
- return false;
+ int ret = Z_OK;
+
+ while (true)
+ {
+ ret = processor.Process(flush);
+ if (ret != Z_OK && ret != Z_STREAM_END)
+ return false;
+
+ if (!processor.BufferIsFull())
+ break;
- if (processor.BufferIsFull())
processor.MoveOut(out);
+ }
if (flush == Z_FINISH && ret == Z_STREAM_END)
break;