diff --git a/desktop_version/src/FileSystemUtils.cpp b/desktop_version/src/FileSystemUtils.cpp index dd0724c8..cda6924c 100644 --- a/desktop_version/src/FileSystemUtils.cpp +++ b/desktop_version/src/FileSystemUtils.cpp @@ -363,6 +363,10 @@ void FILESYSTEM_loadFileToMemory( PHYSFS_sint64 length = PHYSFS_fileLength(handle); if (len != NULL) { + if (length < 0) + { + length = 0; + } *len = length; } if (addnull)