Skip to content

savestate: reject invalid broadcast/cable/region instead of aborting - #2555

Open
JoeMatt wants to merge 1 commit into
flyinghead:masterfrom
Provenance-Emu:fix/savestate-invalid-config-throw
Open

JoeMatt wants to merge 1 commit into
flyinghead:masterfrom
Provenance-Emu:fix/savestate-invalid-config-throw

Conversation

@JoeMatt

@JoeMatt JoeMatt commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

dc_deserialize() read the broadcast, cable and region settings straight
into the config and checked them with verify(), so a corrupt or
incompatible state killed the process, after already writing the bad
values into the settings.

Read them into locals and throw Deserializer::Exception when one is out
of range. dc_loadstate() and the libretro core already catch it and
report the state as unusable. Valid states load exactly as before.

Testing: compiles in the libretro core and the standalone build (macOS arm64). The values are still read in the same order and size, so the state format is unchanged.

🤖 Generated with Claude Code

dc_deserialize() read the broadcast, cable and region settings straight
into the config and checked them with verify(), so a corrupt or
incompatible state killed the process, after already writing the bad
values into the settings.

Read them into locals and throw Deserializer::Exception when one is out
of range. dc_loadstate() and the libretro core already catch it and
report the state as unusable. Valid states load exactly as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 14, 2026 00:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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 this pull request may close these issues.

2 participants