From 2efd32160b05e63846f1002269a7b3a71d1522f6 Mon Sep 17 00:00:00 2001 From: kichik Date: Sat, 23 Feb 2008 16:28:23 +0000 Subject: [PATCH] fixed bug #1874297 - Error decompressing data! Corrupted installer? problem was that decompression ended prematurely. instead of waiting for zlib to return Z_STREAM_END, it checked if no more output was required. this could cause a case where zlib wouldn't read its entire stream. in this particular case, the compressed headers were 0x4001 bytes long and compressed data input buffer size is only 0x4000. instead of waiting for another run of inflate() to read the last byte, which is probably eof, _dodecmop() broke the loop and didn't read that extra byte. since loadHeaders() relays on _dodecomp() to read the entire header so it can calculate where the data block begins, all reads from the data block suddenly became off by one, causing "decompression errors". git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5557 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/fileform.c | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/exehead/fileform.c b/Source/exehead/fileform.c index 11d8cc05..470f46dc 100644 --- a/Source/exehead/fileform.c +++ b/Source/exehead/fileform.c @@ -419,7 +419,6 @@ int NSISCALL _dodecomp(int offset, HANDLE hFileOut, char *outbuf, int outbuflen) retval+=u; outbuffer_len-=u; outbuffer=g_inflate_stream.next_out; - if (outbuffer_len < 1) return retval; } if (err==Z_STREAM_END) return retval; }