aboutsummaryrefslogtreecommitdiff
path: root/backends/saves
diff options
context:
space:
mode:
authorMax Horn2007-03-11 16:00:38 +0000
committerMax Horn2007-03-11 16:00:38 +0000
commit319a1c9b657b46cd7b79a6669939ec59ce352281 (patch)
treeb676a3502656ae3c0efdc123784cd29cf354666c /backends/saves
parent20fce9c87ed1f4682702d92b4b9d5449ef4b9769 (diff)
downloadscummvm-rg350-319a1c9b657b46cd7b79a6669939ec59ce352281.tar.gz
scummvm-rg350-319a1c9b657b46cd7b79a6669939ec59ce352281.tar.bz2
scummvm-rg350-319a1c9b657b46cd7b79a6669939ec59ce352281.zip
Reenabled window bit flags for automatica gzip header detection, and documented which zlib version introduced the feature. Also enforce that zlib version
svn-id: r26093
Diffstat (limited to 'backends/saves')
-rw-r--r--backends/saves/compressed/compressed-saves.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/backends/saves/compressed/compressed-saves.cpp b/backends/saves/compressed/compressed-saves.cpp
index e987b0de59..07dc0d2d29 100644
--- a/backends/saves/compressed/compressed-saves.cpp
+++ b/backends/saves/compressed/compressed-saves.cpp
@@ -28,6 +28,9 @@
#if defined(USE_ZLIB)
#include <zlib.h>
+#if ZLIB_VERNUM < 0x1204
+#error Version 1.2.0.4 or newer of zlib is required for this code
+#endif
/**
* A simple wrapper class which can be used to wrap around an arbitrary
@@ -76,8 +79,10 @@ public:
// Adding 32 to windowBits indicates to zlib that it is supposed to
// automatically detect whether gzip or zlib headers are used for
- // the compressed file.
- _zlibErr = inflateInit2(&_stream, MAX_WBITS);
+ // the compressed file. This feature was added in zlib 1.2.0.4,
+ // released 10 August 2003.
+ // Note: This is *crucial* for savegame compatibility, do *not* remove!
+ _zlibErr = inflateInit2(&_stream, MAX_WBITS + 32);
if (_zlibErr != Z_OK)
return;
@@ -196,12 +201,14 @@ public:
_stream.zfree = Z_NULL;
_stream.opaque = Z_NULL;
- // adding 16 to windowBits indicates to zlib that it is supposed to
- // write gzip headers
+ // Adding 16 to windowBits indicates to zlib that it is supposed to
+ // write gzip headers. This feature was added in zlib 1.2.0.4,
+ // released 10 August 2003.
+ // Note: This is *crucial* for savegame compatibility, do *not* remove!
_zlibErr = deflateInit2(&_stream,
Z_DEFAULT_COMPRESSION,
Z_DEFLATED,
- MAX_WBITS,
+ MAX_WBITS + 16,
8,
Z_DEFAULT_STRATEGY);
assert(_zlibErr == Z_OK);