diff options
| author | Dentomologist <dentomologist@gmail.com> | 2026-03-16 00:49:38 -0700 |
|---|---|---|
| committer | OatmealDome <julian@oatmealdome.me> | 2026-03-17 17:30:23 -0400 |
| commit | 5c9e4f8e476fe9ae574457828fe231bbc7078be3 (patch) | |
| tree | 9d08f44311df2bcd0d9feef54d6bc1a3973df6d7 | |
| parent | c9ea4e3b8e8986b12c6b9ce472c00c1a4df5ccd2 (diff) | |
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.
| -rw-r--r-- | Source/Core/Core/FifoPlayer/FifoDataFile.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/Core/Core/FifoPlayer/FifoDataFile.cpp b/Source/Core/Core/FifoPlayer/FifoDataFile.cpp index 1e7ec5d77e..5c30081393 100644 --- a/Source/Core/Core/FifoPlayer/FifoDataFile.cpp +++ b/Source/Core/Core/FifoPlayer/FifoDataFile.cpp @@ -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) |
