Fix ReadFileEx() arguments when loading scene files

The parser expects NUL terminated data.
This commit is contained in:
Alexander 'z33ky' Hirsch 2021-06-06 15:57:05 +02:00
parent 7d2970eacd
commit e989cf63c5

View File

@ -4298,7 +4298,7 @@ const char *GetFirstSoundInScene(const char *pszScene)
else else
{ {
void *pBuffer = NULL; void *pBuffer = NULL;
if (filesystem->ReadFileEx( pszScene, "MOD", &pBuffer, false, true )) if (filesystem->ReadFileEx( pszScene, "MOD", &pBuffer, true ))
{ {
g_TokenProcessor.SetBuffer((char*)pBuffer); g_TokenProcessor.SetBuffer((char*)pBuffer);
CChoreoScene *pScene = ChoreoLoadScene( pszScene, NULL, &g_TokenProcessor, LocalScene_Printf ); CChoreoScene *pScene = ChoreoLoadScene( pszScene, NULL, &g_TokenProcessor, LocalScene_Printf );
@ -5284,7 +5284,7 @@ int GetSceneSpeechCount( char const *pszScene )
else else
{ {
void *pBuffer = NULL; void *pBuffer = NULL;
if (filesystem->ReadFileEx( pszScene, "MOD", &pBuffer, false, true )) if (filesystem->ReadFileEx( pszScene, "MOD", &pBuffer, true ))
{ {
int iNumSounds = 0; int iNumSounds = 0;
@ -5359,7 +5359,7 @@ void PrecacheInstancedScene( char const *pszScene )
// Attempt to precache manually // Attempt to precache manually
void *pBuffer = NULL; void *pBuffer = NULL;
if (filesystem->ReadFileEx( loadfile, "MOD", &pBuffer, false, true )) if (filesystem->ReadFileEx( loadfile, "MOD", &pBuffer, true ))
{ {
g_TokenProcessor.SetBuffer((char*)pBuffer); g_TokenProcessor.SetBuffer((char*)pBuffer);
CChoreoScene *pScene = ChoreoLoadScene( loadfile, NULL, &g_TokenProcessor, LocalScene_Printf ); CChoreoScene *pScene = ChoreoLoadScene( loadfile, NULL, &g_TokenProcessor, LocalScene_Printf );