prevent invalid memory reference if game has achievements but core doesn't expose memory (#14391)

This commit is contained in:
Jamiras 2022-09-05 21:04:29 -06:00 committed by GitHub
parent 84f599503d
commit 3601610b6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1198,8 +1198,15 @@ void rcheevos_test(void)
/* We were unable to initialize memory earlier, try now */ /* We were unable to initialize memory earlier, try now */
if (rcheevos_locals.memory.count == 0) if (rcheevos_locals.memory.count == 0)
{
rcheevos_validate_memrefs(&rcheevos_locals); rcheevos_validate_memrefs(&rcheevos_locals);
/* rcheevos_validate_memrefs may decide the core doesn't support achievements and
* disable them. if so, bail. */
if (!rcheevos_locals.loaded)
return;
}
rc_runtime_do_frame(&rcheevos_locals.runtime, rc_runtime_do_frame(&rcheevos_locals.runtime,
&rcheevos_runtime_event_handler, rcheevos_peek, NULL, 0); &rcheevos_runtime_event_handler, rcheevos_peek, NULL, 0);
} }