Skip to content

Conversation

@segcore
Copy link
Contributor

@segcore segcore commented Jun 7, 2025

Avoid overrunning the end of the icon buffer (default 256 size) when printing labels with Icons.

Previously, if the user entered a value >255 (e.g. "#999#") the program would read invalid memory (causing a crash with ASAN enabled).


// NOTE: A pointer to current icons array should be defined
static unsigned int *guiIconsPtr = guiIcons;
static int guiIconsCount = RAYGUI_ICON_MAX_ICONS;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to avoid an additional global variable for it, could we just check for RAYGUI_ICON_MAX_ICONS?

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.

2 participants