From 562d6a966eac11f9c1d0916f8a03b32769ab5067 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Fri, 29 Dec 2023 18:33:30 -0500 Subject: [PATCH] Match MxRAMStreamProvider::SetResourceToGet --- LEGO1/mxramstreamprovider.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LEGO1/mxramstreamprovider.cpp b/LEGO1/mxramstreamprovider.cpp index 9c52c20e..fc20bf33 100644 --- a/LEGO1/mxramstreamprovider.cpp +++ b/LEGO1/mxramstreamprovider.cpp @@ -77,14 +77,14 @@ MxResult MxRAMStreamProvider::SetResourceToGet(MxStreamController* p_resource) m_fileSize = m_pFile->CalcFileSize(); if (m_fileSize != 0) { m_bufferSize = m_pFile->GetBufferSize(); - m_pBufferOfFileSize = new MxU32[m_fileSize]; + m_pBufferOfFileSize = (MxU32*) new MxU8[m_fileSize]; if (m_pBufferOfFileSize != NULL && m_pFile->Read((unsigned char*) m_pBufferOfFileSize, m_fileSize) == SUCCESS) { m_lengthInDWords = m_pFile->GetLengthInDWords(); - m_bufferForDWords = new MxU32[m_lengthInDWords * sizeof(MxU32)]; + m_bufferForDWords = new MxU32[m_lengthInDWords]; if (m_bufferForDWords != NULL) { - memcpy(m_bufferForDWords, m_pFile->GetBuffer(), m_lengthInDWords); + memcpy(m_bufferForDWords, m_pFile->GetBuffer(), m_lengthInDWords * sizeof(MxU32)); result = SUCCESS; } }