mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-19 17:49:14 +00:00
text-freetype2: Fix crash after reaching buffer size
The texbuf has a fixed size that won't expand. When a lot of multi-byte characters has arrived, it overflow and src_glyph becomes NULL.
This commit is contained in:
parent
016ce128b7
commit
4fb2bc38de
|
@ -140,7 +140,8 @@ void set_up_vertex_buffer(struct ft2_source *srcdata)
|
||||||
next_char:;
|
next_char:;
|
||||||
glyph_index =
|
glyph_index =
|
||||||
FT_Get_Char_Index(srcdata->font_face, srcdata->text[i]);
|
FT_Get_Char_Index(srcdata->font_face, srcdata->text[i]);
|
||||||
word_width += src_glyph->xadv;
|
if (src_glyph)
|
||||||
|
word_width += src_glyph->xadv;
|
||||||
eos_skip:;
|
eos_skip:;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue