From 22c7664aaf6ed7c2a18dc608e486b07ff9b32c2b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 31 Aug 2014 15:23:22 -0400 Subject: [PATCH] DolphinWX: Fix exporting of Wii save files This would trip an out of bounds assert due the fact that the size is reserved, but the vector is not actually resized. --- Source/Core/DolphinWX/MemoryCards/WiiSaveCrypted.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Source/Core/DolphinWX/MemoryCards/WiiSaveCrypted.cpp b/Source/Core/DolphinWX/MemoryCards/WiiSaveCrypted.cpp index 08b091dc1a..d9d20a523e 100644 --- a/Source/Core/DolphinWX/MemoryCards/WiiSaveCrypted.cpp +++ b/Source/Core/DolphinWX/MemoryCards/WiiSaveCrypted.cpp @@ -445,10 +445,9 @@ void CWiiSaveCrypted::ExportWiiSaveFiles() m_valid = false; } - std::vector file_data, file_data_enc; - file_data.reserve(file_size_rounded); - file_data_enc.reserve(file_size_rounded); - memset(&file_data[0], 0, file_size_rounded); + std::vector file_data(file_size_rounded); + std::vector file_data_enc(file_size_rounded); + if (!raw_save_file.ReadBytes(&file_data[0], file_size)) { ERROR_LOG(CONSOLE, "Failed to read data from file: %s",