Skip to content

Commit f3316e9

Browse files
committed
GUI: fix crash on zero-width text.
1 parent 980e0bc commit f3316e9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

plugins/gui/gui.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,9 @@ bool ctr_internal_gui_describe_glyph(const lv_font_t * f, lv_font_glyph_dsc_t *
226226
*(glyph_dsc) = cache->dsc;
227227
return true;
228228
}
229-
SDL_Color white = {255, 255, 255, 255};
230-
SDL_Surface* glyph_surface = TTF_RenderGlyph_Blended(((GUIFNT*)f->dsc)->font, (uint16_t)unicode, white);
229+
SDL_Color white = {255, 255, 255, 255};
230+
SDL_Surface* glyph_surface = TTF_RenderGlyph32_Blended(((GUIFNT*)f->dsc)->font, unicode, white);
231+
if (!glyph_surface) return false;
231232
int w = glyph_surface->w;
232233
int h = glyph_surface->h;
233234
glyph_dsc->box_w = glyph_surface->w;

0 commit comments

Comments
 (0)