[coverity] 1543037 Out-of-bounds read

This commit is contained in:
akallabeth 2024-04-11 10:47:12 +02:00 committed by akallabeth
parent 80c562d040
commit 55aa202ff5

View File

@ -410,7 +410,7 @@ static int rdtk_font_parse_descriptor_buffer(rdtkFont* font, uint8_t* buffer, si
*r = '\0'; *r = '\0';
/* start parsing glyph */ /* start parsing glyph */
if (index > font->glyphCount) if (index >= font->glyphCount)
return -1; return -1;
rdtkGlyph* glyph = &font->glyphs[index]; rdtkGlyph* glyph = &font->glyphs[index];