Skip to content

fix: SDL_RenderTextureTiled on Metal - infinite loop + memory allocs on an out of bounds src rect - #16025

Open
transmutrix wants to merge 1 commit into
libsdl-org:mainfrom
transmutrix:fix-SDL_RenderTextureTiled-oob
Open

fix: SDL_RenderTextureTiled on Metal - infinite loop + memory allocs on an out of bounds src rect#16025
transmutrix wants to merge 1 commit into
libsdl-org:mainfrom
transmutrix:fix-SDL_RenderTextureTiled-oob

Conversation

@transmutrix

Copy link
Copy Markdown
  • I confirm that I am the author of this code and release it to the SDL project under the Zlib license. This contribution does not contain code from other sources, including code generated by a Large Language Model ("AI").

Adds source rect area sanity check to SDL_RenderTextureTiled and SDL_RenderTextureTiled_Iterate.

Description

I had an occasional hard-to-repro freeze in my game where my main process would hit an infinite loop and allocate 25+ GB of RAM. I messed up some arithmetic on a timer value for an animation, and I was passing a bogus source rect for my texture to SDL_RenderTextureTiled, one which had no area because it was out of bounds, but which still touched the edge of the texture, so passed through the existing checks.

Existing Issue(s)

…sed an oob source rect that touched the edge of the texture but had zero area
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