Skip to content

Conversation

@ej-sanmartin
Copy link
Contributor

Description

There's a bug caused by missing bounds checks in several SDL_Bind* and SDL_Push* GPU functions that write into fixed-size debug tracking arrays. The fix is to add validation (e.g., first_slot + num_bindings > MAX_*) before those writes to prevent immediate or downstream crashes.

Existing Issue(s)

Fixes #14679

@thatcosmonaut
Copy link
Collaborator

This looks right. Could we also check the ShaderCreateInfo structs to make sure they aren't declaring more resources than can be bound? That would catch issues sooner in execution than the binding calls.

@ej-sanmartin
Copy link
Contributor Author

Good idea, will send out another commit soon.

@slouken slouken merged commit bd29d60 into libsdl-org:main Dec 23, 2025
43 checks passed
@slouken
Copy link
Collaborator

slouken commented Dec 23, 2025

Looks good, thanks!

slouken pushed a commit that referenced this pull request Dec 23, 2025
@slouken slouken added this to the 3.2.30 milestone Dec 23, 2025
sezero added a commit that referenced this pull request Dec 24, 2025
… pushes. (#14692)"

This reverts commit 4b0a1df.
(Was cherry picked from commit bd29d60)
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.

GPU: Hitting sanitizer trap on read only buffer count > 8 on debug mode

3 participants