From edff9621621eafd4c3a26fb37b3f30eb964660f7 Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 2 May 2008 19:04:36 +0000 Subject: [PATCH] applied patch #1948700 - support for files between 1.6 and 2 GB git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5620 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/build.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/build.cpp b/Source/build.cpp index a9e5200b..ea64ae27 100644 --- a/Source/build.cpp +++ b/Source/build.cpp @@ -721,7 +721,10 @@ int CEXEBuild::add_db_data(IMMap *mmap) // returns offset { // grow datablock so that there is room to compress into int bufferlen = length + 1024 + length / 4; // give a nice 25% extra space - db->resize(st + bufferlen + sizeof(int)); + if (bufferlen < 0) // too much data... try allocating as much as possible + db->resize(max(st, 0x7fffffff)); + else + db->resize(st + bufferlen + sizeof(int)); int n = compressor->Init(build_compress_level, build_compress_dict_size); if (n != C_OK)