Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Savegame load of versions >= SLV_RIFF_TO_ARRAY fails to correctly load gamelog LoggedChange items #9740

Closed
JGRennison opened this issue Dec 10, 2021 · 0 comments · Fixed by #9741

Comments

@JGRennison
Copy link
Contributor

Version of OpenTTD

master

Expected result

Gamelog loaded correctly

Actual result

In SlGamelogAction::Load LoggedAction::changes is never assigned in the non IsSavegameVersionBefore(SLV_RIFF_TO_ARRAY) path.
LoggedChange items are loaded into LoggedAction::change beyond the logical (but not allocated) end of the array.
When the Gamelog is cleared, pointers referenced by LoggedChange items are leaked, which is how the issue was noticed.

Steps to reproduce

Load a savegame with a version >= SLV_RIFF_TO_ARRAY (294).
Run the gamelog command or otherwise observe the gamelog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant