- Handle the case where the EMUFILE size is less than the DeSmuME footer size. Allows an in-memory BackupDevice to work with NAND flash saves.
This commit is contained in:
rogerman 2015-03-19 22:06:26 +00:00
parent 3331fb1890
commit 1674170370
1 changed files with 6 additions and 0 deletions

View File

@ -414,6 +414,12 @@ BackupDevice::~BackupDevice()
int BackupDevice::readFooter()
{
// Check if the footer data exists.
if (fpMC->size() < (strlen(kDesmumeSaveCookie) + strlen(DESMUME_BACKUP_FOOTER_TXT) + 24))
{
return -1;
}
//scan for desmume save footer
const s32 cookieLen = (s32)strlen(kDesmumeSaveCookie);
char *sigbuf = new char[cookieLen];