Skip to content

Conversation

@ZERICO2005
Copy link
Contributor

@ZERICO2005 ZERICO2005 commented Oct 20, 2025

MERGE #657 BEFORE THIS!!!

fixes #658
gfx_AllocSprite made an invalid assumption that the allocation routine would preserve the stack parameters. allocation routines such as __simple_malloc destroy the stack parameter, which can cause a returned non-NULL pointer to be off by one. This is especially problematic when this off-by-one pointer has to be freed.

The bug with the width * height == 0 case is assumed to be undefined behavior, since the sprite routines don't handle this case either.

@ZERICO2005 ZERICO2005 marked this pull request as ready for review October 27, 2025 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

gfx_AllocSprite bugs

2 participants