From c2c23677edeaeb935aa606625be86cc7da29bf5c Mon Sep 17 00:00:00 2001 From: spycrab Date: Wed, 2 Jan 2019 22:47:18 +0100 Subject: [PATCH] UICommon/ResourcePack: Fix resource packs without manifests being able to crash dolphin --- Source/Core/UICommon/ResourcePack/Manager.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/Core/UICommon/ResourcePack/Manager.cpp b/Source/Core/UICommon/ResourcePack/Manager.cpp index ce739536d4..03456d3428 100644 --- a/Source/Core/UICommon/ResourcePack/Manager.cpp +++ b/Source/Core/UICommon/ResourcePack/Manager.cpp @@ -54,7 +54,11 @@ bool Init() { const auto& path = pack_list[i]; - error |= !Add(path); + if (!Add(path)) + { + error = true; + continue; + } order->Set(packs[i].GetManifest()->GetID(), static_cast(i)); } @@ -107,6 +111,9 @@ bool Add(const std::string& path, int offset) ResourcePack pack(path); + if (!pack.IsValid()) + return false; + IniFile file = GetPackConfig(); auto* order = file.GetOrCreateSection("Order");