Skip to content

Fix PC sprite left-edge clipping underwrite#122

Merged
segrax merged 1 commit into
masterfrom
codex/fix-left-edge-sprite-clipping-vulnerability
May 24, 2026
Merged

Fix PC sprite left-edge clipping underwrite#122
segrax merged 1 commit into
masterfrom
codex/fix-left-edge-sprite-clipping-vulnerability

Conversation

@segrax
Copy link
Copy Markdown
Member

@segrax segrax commented May 24, 2026

Motivation

  • Prevent a heap-buffer underwrite in the PC renderer where left-edge clipping could leave mVideo_Draw_PosX negative and cause Video_Draw_8 to write before the row/buffer start.

Description

  • Add a post-clip guard in cGraphics_PC::Sprite_OnScreen_Check (Source/PC/Graphics_PC.cpp) that advances mVideo_Draw_PosX to non-negative and reduces mVideo_Draw_Columns when left-edge clipping would otherwise leave PosX < 0.

Testing

  • No automated unit tests were run against the patched code in this environment; a full build with SDL headers was not possible here.

Codex Task

@segrax segrax merged commit 71e63a7 into master May 24, 2026
0 of 6 checks passed
@segrax segrax deleted the codex/fix-left-edge-sprite-clipping-vulnerability branch May 24, 2026 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant