From 6576adb80b91d9bad93a7d1ac27a25685590fdf4 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 13 Jul 2021 12:34:35 +0200 Subject: [PATCH] - Blood: validate .ini files before using them. They must at least have one "Episode?" section to be accepted. --- source/games/blood/src/levels.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/source/games/blood/src/levels.cpp b/source/games/blood/src/levels.cpp index ee1cbfad5..b9bc85867 100644 --- a/source/games/blood/src/levels.cpp +++ b/source/games/blood/src/levels.cpp @@ -126,7 +126,19 @@ static const char* DefFile(void) if (ext.CompareNoCase(".ini") == 0) { if (fileSystem.CheckNumForFullName(fn) != i) continue; - if (found == -1) found = i; + if (found == -1) + { + IniFile inif(fn); + for (int j = 1; j <= 6; j++) + { + FStringf key("Episode%d", j); + if (inif.FindKey(key)) + { + found = i; + break; + } + } + } else { found = -1;