MemArena and bounds fixes - #22191
Open
hrydgard wants to merge 7 commits into
Open
Conversation
Owner
Author
|
This can't be merged as-is, the UWP stuff is broken. |
Horizon's CreateView printed 'Fatal error creating the view' and then returned base anyway, so the caller recorded an unmapped address as a live view. Posix's ftruncate failure was logged with a '// Should this be a failure?' - it is: the mmaps afterwards succeed against a short file and the first touch past its end raises SIGBUS, which is only hooked under __APPLE__.
A hashrange of 'addr,w,h = 0,0' passed validation (0 isn't bigger than the source), became desc_.newW/newH, and ReplacedTexture::Prepare divides by them. A post-shader SSAA level multiplies the render resolution with no upper bound, while the texture-shader Scale sitting a few lines away is checked against 2..8.
corners and verts are carved out of decoded_ at fixed offsets 6*65536 bytes apart, and NormalizeVertices fills corners with indexUpperBound - indexLowerBound + 1 SimpleVertex. The vertexCount > 1024 guard doesn't bound that: the index values come from the game, so 1024 indices can span the full 16-bit range and run corners into verts, making the cull decision from overwritten data. Bail on an index over 1024 and report visible - a bbox test that large isn't worth doing anyway.
CmdLine used std::stoi/std::stod and Compatibility used stoi/stof, all of which throw on junk with nothing catching them. 'PPSSPPHeadless --timeout=abc' aborted the process, and so did a bad value in a [PostShaderSetting]-style compat section - at startup, with no diagnostic. Parse with sscanf and report it: CmdLine already has the pattern for this in its Bool case, and Config.cpp's ini reads were fixed the same way earlier. A bad compat.ini entry now warns and keeps the default.
CustomButtonMappingScreen indexes customKeyImages[36] and customKeyShapes[11] with values read straight from the ini, and it's reachable from the main menu - so neither GamepadEmu nor TouchControlLayoutScreen, which both sanitize first, need have run. Those two had the same fixup copy-pasted; hoisted it into a Sanitize() next to the tables and called it from all three.
Git Bash strips one level of backslash escaping even with a quoted delimiter, so a '\n' meant to land in the output arrives as '\n' and Python writes a real newline instead. Records both failure signatures - a C2001 for the first, a silently non-matching anchor for the second - and when to reach for Edit or a script file.
hrydgard
force-pushed
the
memarena-and-bounds-fixes
branch
from
August 31, 2026 20:36
f12307d to
65284fa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.