Skip to content

Commit 9b9be4f

Browse files
chearonzbjornson
authored andcommitted
fix broken font matching due to a use-after-free
f3184ba introduced a use-after- free bug. Pango does not copy the string when you use the _static version of pango_font_description_set_family. Font selection was not working for me at all.
1 parent 16c28ab commit 9b9be4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/register_font.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ get_pango_font_description(unsigned char* filepath) {
303303
return NULL;
304304
}
305305

306-
pango_font_description_set_family_static(desc, family);
306+
pango_font_description_set_family(desc, family);
307307
free(family);
308308
pango_font_description_set_weight(desc, get_pango_weight(table->usWeightClass));
309309
pango_font_description_set_stretch(desc, get_pango_stretch(table->usWidthClass));

0 commit comments

Comments
 (0)