From e1e5b4e92bcd460b43ce1b852560751b6525593e Mon Sep 17 00:00:00 2001 From: Clement Sibille Date: Tue, 27 Feb 2024 17:23:33 +0900 Subject: Implement Deflate decompression This patch adds the decompression code for zlib compressed data streams that are compressed using Deflate based on RFC-1950 and RFC-1951. This implementation lacks support for zlib prefix dictionaries and for non-compressed Deflate blocks as these are less common. --- lisiblepng/src/lisiblepng.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lisiblepng/src/lisiblepng.c') diff --git a/lisiblepng/src/lisiblepng.c b/lisiblepng/src/lisiblepng.c index 3dfda24..5ccd300 100644 --- a/lisiblepng/src/lisiblepng.c +++ b/lisiblepng/src/lisiblepng.c @@ -76,6 +76,9 @@ void DeflateDecompressor_init(DeflateDecompressor *ctx, FILE *stream) { ASSERT(ctx != NULL); ASSERT(stream != NULL); ctx->stream = stream; +#ifdef LISIBLE_PNG_COMPUTE_CRC + ctx->computed_crc = 0xFFFFFFFFu; +#endif // LISIBLE_PNG_COMPUTE_CRC } void ParsingContext_crc_reset(DeflateDecompressor *ctx) { -- cgit v1.2.3