Skip to content

Commit

Permalink
Find in hash table, use correct value size
Browse files Browse the repository at this point in the history
  • Loading branch information
1bsyl committed Jan 27, 2025
1 parent 6d8e364 commit 22d2f64
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/SDL_ttf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2967,9 +2967,12 @@ static bool Find_GlyphByIndex(TTF_Font *font, FT_UInt idx,
static FT_UInt get_char_index(TTF_Font *font, Uint32 ch)
{
FT_UInt idx = 0;
if (!SDL_FindInHashTable(font->glyph_indices, (const void *)(uintptr_t)ch, (const void **)&idx)) {
const void *value;
if (!SDL_FindInHashTable(font->glyph_indices, (const void *)(uintptr_t)ch, &value)) {
idx = FT_Get_Char_Index(font->face, ch);
SDL_InsertIntoHashTable(font->glyph_indices, (const void *)(uintptr_t)ch, (const void *)(uintptr_t)idx);
} else {
idx = (FT_UInt)(uintptr_t)value;
}
return idx;
}
Expand Down

0 comments on commit 22d2f64

Please sign in to comment.