From fdd197475bd17696921c9ceba7c664a86ee7ccb9 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Fri, 9 Jun 2017 17:44:43 +0200 Subject: [PATCH] Boot: Check TMD validity before reading from TMD Otherwise Dolphin crashes when trying to boot a Wii game with an invalid TMD. --- Source/Core/Core/Boot/Boot_BS2Emu.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Core/Core/Boot/Boot_BS2Emu.cpp b/Source/Core/Core/Boot/Boot_BS2Emu.cpp index 0c3848f9a1..22737f4246 100644 --- a/Source/Core/Core/Boot/Boot_BS2Emu.cpp +++ b/Source/Core/Core/Boot/Boot_BS2Emu.cpp @@ -343,6 +343,9 @@ bool CBoot::EmulatedBS2_Wii(const DiscIO::Volume* volume) const DiscIO::Partition partition = volume->GetGamePartition(); const IOS::ES::TMDReader tmd = volume->GetTMD(partition); + if (!tmd.IsValid()) + return false; + if (!SetupWiiMemory(volume, tmd.GetIOSId())) return false;