From 5782206a9138003fe0b9b80ce95012fd1f09efab Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 10 Oct 2024 08:46:00 +0200 Subject: [PATCH] Validate the file reader in DoOpenResourceFile. --- source/common/filesystem/source/resourcefile.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/source/common/filesystem/source/resourcefile.cpp b/source/common/filesystem/source/resourcefile.cpp index 81e2b7850..00a5234ca 100644 --- a/source/common/filesystem/source/resourcefile.cpp +++ b/source/common/filesystem/source/resourcefile.cpp @@ -162,6 +162,7 @@ static int nulPrintf(FSMessageLevel msg, const char* fmt, ...) FResourceFile *FResourceFile::DoOpenResourceFile(const char *filename, FileReader &file, bool containeronly, LumpFilterInfo* filter, FileSystemMessageFunc Printf, StringPool* sp) { + if (!file.isOpen()) return nullptr; if (Printf == nullptr) Printf = nulPrintf; for(auto func : funcs) {