diff --git a/src/Zlib.Shared/Deflate.cs b/src/Zlib.Shared/Deflate.cs index 9672250..9950b6a 100644 --- a/src/Zlib.Shared/Deflate.cs +++ b/src/Zlib.Shared/Deflate.cs @@ -1667,12 +1667,12 @@ internal int SetParams(CompressionLevel level, CompressionStrategy strategy) internal int SetDictionary(byte[] dictionary) { - int length = dictionary.Length; - int index = 0; - if (dictionary == null || status != INIT_STATE) throw new ZlibException("Stream error."); + int length = dictionary.Length; + int index = 0; + _codec._Adler32 = Adler.Adler32(_codec._Adler32, dictionary, 0, dictionary.Length); if (length < MIN_MATCH) @@ -1876,4 +1876,4 @@ internal int Deflate(FlushType flush) } } -} \ No newline at end of file +}