RetroAchievements: Avoid uninitialized memory access

Avoid creating and then destroying a leaderboard list when game is null,
as doing so causes an access to uninitialized memory due to a bug in
rcheevos.

This can be triggered by starting a game with an invalid or expired
login token.
This commit is contained in:
Dentomologist 2025-09-05 17:23:39 -07:00
parent 489952cf89
commit 85a89eb420

View File

@ -1027,6 +1027,9 @@ void AchievementManager::LoadGameCallback(int result, const char* error_message,
OSD::Color::RED);
}
if (game == nullptr)
return;
rc_client_set_read_memory_function(instance.m_client, MemoryPeeker);
instance.FetchGameBadges();
instance.m_system.store(&Core::System::GetInstance(), std::memory_order_release);