Skip to content

Validate pending MDEC table commands in save states - #190

Open
acts-1631 wants to merge 1 commit into
libretro:mainfrom
acts-1631:validate-mdec-state
Open

acts-1631 wants to merge 1 commit into
libretro:mainfrom
acts-1631:validate-mdec-state

Conversation

@acts-1631

Copy link
Copy Markdown
Contributor

MDEC::DoState() accepted pending SetIqTable and SetScaleTable commands with inconsistent m_remaining_halfwords values. A later MDEC::Execute() call could dispatch a handler that pops a fixed number of entries from m_data_in_fifo, underflowing its size. Subsequent state serialization could then loop over a near-UINT32_MAX entry count and hang a netplay client receiving a crafted rollback state.

Validate the exact pending counts produced for IQ and scale table commands. Invalid states reset MDEC before being rejected so failed nontransactional rollback loads remain safe.

MDEC table handlers pop fixed numbers of halfwords, but save states
could restore smaller remaining counts. A later command execution
underflowed the input FIFO size and could stall future serialization.

Reject inconsistent pending table commands and reset MDEC before
returning so failed nontransactional loads remain safe.
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.

1 participant