summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/VolumeWad.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/DiscIO/VolumeWad.cpp')
-rw-r--r--Source/Core/DiscIO/VolumeWad.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/Core/DiscIO/VolumeWad.cpp b/Source/Core/DiscIO/VolumeWad.cpp
index cc83f59081..e471edcd1d 100644
--- a/Source/Core/DiscIO/VolumeWad.cpp
+++ b/Source/Core/DiscIO/VolumeWad.cpp
@@ -156,6 +156,9 @@ bool VolumeWAD::CheckContentIntegrity(const IOS::ES::Content& content,
const std::vector<u8>& encrypted_data,
const IOS::ES::TicketReader& ticket) const
{
+ if (encrypted_data.size() != Common::AlignUp(content.size, 0x40))
+ return false;
+
mbedtls_aes_context context;
const std::array<u8, 16> key = ticket.GetTitleKey();
mbedtls_aes_setkey_dec(&context, key.data(), 128);