From b5a2f34a3778a1921e2d448557d4557807364f6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Fri, 26 May 2017 11:23:11 +0200 Subject: Check TMD sizes using the actual constant 0x49e4 is the actual maximum TMD size (which is checked against in ES). IsValidTMDSize is added to ESFormats to avoid duplicating the constant. --- Source/Core/DiscIO/VolumeWad.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/DiscIO/VolumeWad.cpp') diff --git a/Source/Core/DiscIO/VolumeWad.cpp b/Source/Core/DiscIO/VolumeWad.cpp index f170abdd47..86932f897b 100644 --- a/Source/Core/DiscIO/VolumeWad.cpp +++ b/Source/Core/DiscIO/VolumeWad.cpp @@ -41,7 +41,7 @@ CVolumeWAD::CVolumeWAD(std::unique_ptr reader) : m_reader(std::move m_opening_bnr_offset = m_tmd_offset + Common::AlignUp(m_tmd_size, 0x40) + Common::AlignUp(m_data_size, 0x40); - if (m_tmd_size > 1024 * 1024 * 4) + if (!IOS::ES::IsValidTMDSize(m_tmd_size)) { ERROR_LOG(DISCIO, "TMD is too large: %u bytes", m_tmd_size); return; -- cgit v1.2.3