text-freetype2: Fix a crash if there's insufficient glyph texture space

上级 c2e49263
......@@ -271,6 +271,11 @@ void cache_glyphs(struct ft2_source *srcdata, wchar_t *cache_glyphs)
dy += srcdata->max_h + 1;
}
if (dy + g_h >= texbuf_h) {
blog(LOG_WARNING, "Out of space trying to render glyphs");
break;
}
src_glyph = bzalloc(sizeof(struct glyph_info));
src_glyph->u = (float)dx / (float)texbuf_w;
src_glyph->u2 = (float)(dx + g_w) / (float)texbuf_w;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册