int ret = z_inflateInit_ (strm, version, stream_size);
if (ret == Z_OK) {
ZWRAP_DCtx* zwd = (ZWRAP_DCtx*)strm->state;
+ if (zwd == NULL) return Z_STREAM_ERROR;
zwd->windowBits = windowBits;
}
return ret;
}
+#if ZLIB_VERNUM >= 0x1240
+ZEXTERN int ZEXPORT z_inflateReset2 OF((z_streamp strm,
+ int windowBits))
+{
+ if (!strm->reserved)
+ return inflateReset2(strm, windowBits);
+
+ { int ret = z_inflateReset (strm);
+ if (ret == Z_OK) {
+ ZWRAP_DCtx* zwd = (ZWRAP_DCtx*)strm->state;
+ if (zwd == NULL) return Z_STREAM_ERROR;
+ zwd->windowBits = windowBits;
+ }
+ return ret;
+ }
+}
+#endif
+
+
ZEXTERN int ZEXPORT z_inflateSetDictionary OF((z_streamp strm,
const Bytef *dictionary,
uInt dictLength))
}
-#if ZLIB_VERNUM >= 0x1240
-ZEXTERN int ZEXPORT z_inflateReset2 OF((z_streamp strm,
- int windowBits))
-{
- if (!strm->reserved)
- return inflateReset2(strm, windowBits);
- FINISH_WITH_ERR(strm, "inflateReset2 is not supported!");
-}
-#endif
-
-
#if ZLIB_VERNUM >= 0x1240
ZEXTERN long ZEXPORT z_inflateMark OF((z_streamp strm))
{