Add range check to ttfGetExtents.

This commit is contained in:
Michael R Sweet
2025-12-02 15:01:16 -05:00
parent 597c9f8cda
commit 7d412cf855

2
ttf.c
View File

@@ -608,7 +608,7 @@ ttfGetExtents(
}
// Find its width...
if ((widths = font->widths[ch / 256]) != NULL)
if (ch < TTF_FONT_MAX_CHAR && (widths = font->widths[ch / 256]) != NULL)
{
if (first)
{