From 191e4266f4341dbb470fcf4b63fe2d5cf0de06d2 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Thu, 8 Apr 2021 17:45:13 +0100 Subject: [PATCH] Fix ftell() error sentinel value being used in allocation --- src/ini_load.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ini_load.cpp b/src/ini_load.cpp index ad613c7208..86cc8d5d5d 100644 --- a/src/ini_load.cpp +++ b/src/ini_load.cpp @@ -209,7 +209,7 @@ void IniLoadFile::LoadFromDisk(const std::string &filename, Subdirectory subdir, if (save != nullptr) { save->clear(); - save->reserve(end); + if (end < (1 << 20)) save->reserve(end); } end += ftell(in);