From 0e23dfbb256783a41a0f400251d64d5f4c2c3474 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Sun, 16 Jan 2022 21:28:44 -0800 Subject: [PATCH] FifoDataFile: Stop ignoring size The size variable started to be unused when I created std::array variants of ReadArray, but we should follow it in case any files have fewer registers stored than they should (otherwise the remaining registers would end up with garbage data from later in the fifolog). Though, there probably aren't many fifologs where this is relevant. --- Source/Core/Core/FifoPlayer/FifoDataFile.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/FifoPlayer/FifoDataFile.cpp b/Source/Core/Core/FifoPlayer/FifoDataFile.cpp index 7bfdff7833..119e19d861 100644 --- a/Source/Core/Core/FifoPlayer/FifoDataFile.cpp +++ b/Source/Core/Core/FifoPlayer/FifoDataFile.cpp @@ -285,19 +285,19 @@ std::unique_ptr FifoDataFile::Load(const std::string& filename, bo u32 size = std::min(BP_MEM_SIZE, header.bpMemSize); file.Seek(header.bpMemOffset, File::SeekOrigin::Begin); - file.ReadArray(&dataFile->m_BPMem); + file.ReadArray(dataFile->m_BPMem.data(), size); size = std::min(CP_MEM_SIZE, header.cpMemSize); file.Seek(header.cpMemOffset, File::SeekOrigin::Begin); - file.ReadArray(&dataFile->m_CPMem); + file.ReadArray(dataFile->m_CPMem.data(), size); size = std::min(XF_MEM_SIZE, header.xfMemSize); file.Seek(header.xfMemOffset, File::SeekOrigin::Begin); - file.ReadArray(&dataFile->m_XFMem); + file.ReadArray(dataFile->m_XFMem.data(), size); size = std::min(XF_REGS_SIZE, header.xfRegsSize); file.Seek(header.xfRegsOffset, File::SeekOrigin::Begin); - file.ReadArray(&dataFile->m_XFRegs); + file.ReadArray(dataFile->m_XFRegs.data(), size); // Texture memory saving was added in version 4. dataFile->m_TexMem.fill(0);