Fix SFMDATA getting a terminator that it shouldn't get if NULL pointer is given (#290)
This commit is contained in:
parent
61709a0e6d
commit
b66bcfb3e2
|
@ -1057,7 +1057,12 @@ static int iNES_Init(int num) {
|
|||
}
|
||||
}
|
||||
if (head.ROM_type & 8)
|
||||
{
|
||||
if (ExtraNTARAM != NULL)
|
||||
{
|
||||
AddExState(ExtraNTARAM, 2048, 0, "EXNR");
|
||||
}
|
||||
}
|
||||
tmp->init(&iNESCart);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -860,6 +860,9 @@ void ResetExState(void (*PreSave)(void), void (*PostSave)(void))
|
|||
|
||||
void AddExState(void *v, uint32 s, int type, const char *desc)
|
||||
{
|
||||
//do not accept extra state information if a null pointer was provided for v, so list won't terminate early
|
||||
if (v == 0) return;
|
||||
|
||||
if(s==~0)
|
||||
{
|
||||
SFORMAT* sf = (SFORMAT*)v;
|
||||
|
|
Loading…
Reference in New Issue