mirror of
https://github.com/ladislav-zezula/StormLib.git
synced 2026-02-01 03:56:23 +01:00
* Release 9.23
* Fixed regressions * Fixed test program
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user