FifoPlayer: Fix hang when taking screenshot during FIFO log playback

Don't copy null terminators from the log's `header.gameid` into
`FifoDataFile`'s `m_game_id`.

Doing so would cause an infinite loop in `Core::GenerateScreenshotName`
as the various concatenations and `fmt::format` calls would then
effectively drop all the timestamps and disambiguating arbitrary numbers
since they followed the null terminator in the gameid, and so the
`File::Exists` calls would always return true.

Fixes https://bugs.dolphin-emu.org/issues/14002.
This commit is contained in:
Dentomologist 2026-03-16 00:49:38 -07:00
parent 66db206e34
commit 3e7ba69205

View File

@ -274,7 +274,8 @@ std::unique_ptr<FifoDataFile> FifoDataFile::Load(const std::string& filename, bo
}
else
{
dataFile->m_game_id = std::string{header.gameid, DEFAULT_GAME_ID.size()};
const size_t gameid_length = strnlen(header.gameid, DEFAULT_GAME_ID.size());
dataFile->m_game_id = std::string{header.gameid, gameid_length};
}
if (flagsOnly)