Skip to content

Bounds-check Cg binary byte swapping - #19387

Merged
elad335 merged 1 commit into
RPCS3:masterfrom
acts-1631:cg-disasm-bounds
Sep 2, 2026
Merged

Bounds-check Cg binary byte swapping#19387
elad335 merged 1 commit into
RPCS3:masterfrom
acts-1631:cg-disasm-bounds

Conversation

@acts-1631

Copy link
Copy Markdown
Contributor

The Cg disassembler can be opened on any file with an .fpo or .vpo extension. When the file indicates a big-endian shader, ConvertToLE swaps a fixed-size header and several offset-based ranges without checking that they fit in the loaded file. A short or malformed file can therefore write past m_buffer.

This adds bounds checks for the header, parameter table, microcode, and program header. Invalid files are ignored by the disassembler instead of being processed.

@elad335
elad335 enabled auto-merge (rebase) September 2, 2026 18:38
@elad335
elad335 merged commit df92b1d into RPCS3:master Sep 2, 2026
10 checks passed
@irusansan

irusansan commented Sep 3, 2026

Copy link
Copy Markdown

I'm having a problem with this build and the previous ones (after v0.0.42-19845), especially in Army of TWO: The 40th Day. It stutters a lot and when the aggro bar is rising, the screen glitches like in the video down below.

Bug.RPCS3.mp4

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.

3 participants