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:
1 parent
489952cf89
commit
85a89eb420
1 file changed
+3
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user