diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index af04a922a..92799baf9 100755 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -582,7 +582,9 @@ bool GameInfo::loadROM(u8* file, s32 fileSize) closeROM(); // create memory stream - reader = MemROMReaderRead_TrueInit(file, fileSize); + romdataForReader = new u8[fileSize]; + memcpy(romdataForReader, file, fileSize); + reader = MemROMReaderRead_TrueInit(romdataForReader, fileSize); fROM = reader->Init(NULL); headerOffset = 0;