aboutsummaryrefslogtreecommitdiff
path: root/src/SFileListFile.cpp
diff options
context:
space:
mode:
authorLadislav Zezula <zezula@volny.cz>2020-11-21 04:27:09 +0100
committerLadislav Zezula <zezula@volny.cz>2020-11-21 04:27:09 +0100
commit809005c7f025bcc55bfa4ede78cb4cc45d3c0e6c (patch)
treee5d10b093dd215147f3e7128b11f96cc6afed04a /src/SFileListFile.cpp
parentaea84bea149020385eadcd3df348d8e6fcbab733 (diff)
* Release 9.23v9.23
* Fixed regressions * Fixed test program
Diffstat (limited to 'src/SFileListFile.cpp')
-rw-r--r--src/SFileListFile.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/SFileListFile.cpp b/src/SFileListFile.cpp
index aa8969c..fe9bc69 100644
--- a/src/SFileListFile.cpp
+++ b/src/SFileListFile.cpp
@@ -17,7 +17,7 @@
// Listfile entry structure
#define CACHE_BUFFER_SIZE 0x1000 // Size of the cache buffer
-#define MAX_LISTFILE_SIZE 0x04000000 // Maximum accepted listfile size is about 68 MB
+#define MAX_LISTFILE_SIZE 0x8000000 // Maximum accepted listfile size is 128 MB
union TListFileHandle
{
@@ -148,6 +148,10 @@ static TListFileCache * CreateListFileCache(
TListFileCache * pCache = NULL;
TListFileHandle ListHandle = {NULL};
+ // Put default value to dwMaxSize
+ if(dwMaxSize == 0)
+ dwMaxSize = MAX_LISTFILE_SIZE;
+
// Internal listfile: hMPQ must be non NULL and szListFile must be NULL.
// We load the MPQ::(listfile) file
if(hMpq != NULL && szListFile == NULL)
@@ -181,7 +185,7 @@ static TListFileCache * CreateListFileCache(
{
// Verify the file size
FileStream_GetSize(ListHandle.pStream, &FileSize);
- if(0 < FileSize && FileSize < MAX_LISTFILE_SIZE)
+ if(0 < FileSize && FileSize < dwMaxSize)
{
pCache = CreateListFileCache(LoadListFile_Stream, &ListHandle, szWildCard, (DWORD)FileSize, dwMaxSize, dwFlags);
}