From 5b837a11e45b8b4607440df0202a2124082e3acc Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 6 Sep 2014 12:44:09 -0400 Subject: [PATCH] DolphinWX: Fix Wii save importing Calls to reserve don't resize the array to accomodate the given data size. These vectors should be initialized with the size directly. --- Source/Core/DolphinWX/MemoryCards/WiiSaveCrypted.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/DolphinWX/MemoryCards/WiiSaveCrypted.cpp b/Source/Core/DolphinWX/MemoryCards/WiiSaveCrypted.cpp index d9d20a523e..c122b32d76 100644 --- a/Source/Core/DolphinWX/MemoryCards/WiiSaveCrypted.cpp +++ b/Source/Core/DolphinWX/MemoryCards/WiiSaveCrypted.cpp @@ -354,9 +354,9 @@ void CWiiSaveCrypted::ImportWiiSaveFiles() { file_size = Common::swap32(file_hdr_tmp.size); u32 file_size_rounded = ROUND_UP(file_size, BLOCK_SZ); - std::vector file_data, file_data_enc; - file_data.reserve(file_size_rounded); - file_data_enc.reserve(file_size_rounded); + std::vector file_data(file_size_rounded); + std::vector file_data_enc(file_size_rounded); + if (!data_file.ReadBytes(&file_data_enc[0], file_size_rounded)) { ERROR_LOG(CONSOLE, "Failed to read data from file %d", i);