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
This commit is contained in:
kichik 2008-02-23 16:28:23 +00:00
parent e3b9d1311b
commit 2efd32160b

View file

@ -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;
}