From 809005c7f025bcc55bfa4ede78cb4cc45d3c0e6c Mon Sep 17 00:00:00 2001 From: Ladislav Zezula Date: Sat, 21 Nov 2020 04:27:09 +0100 Subject: * Release 9.23 * Fixed regressions * Fixed test program --- src/SFileListFile.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/SFileListFile.cpp') 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); } -- cgit v1.2.3