Skip to content

Commit

Permalink
fix broken font matching due to a use-after-free
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chearon authored and zbjornson committed Sep 26, 2023
1 parent 16c28ab commit 9b9be4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/register_font.cc
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ get_pango_font_description(unsigned char* filepath) {
return NULL;
}

pango_font_description_set_family_static(desc, family);
pango_font_description_set_family(desc, family);
free(family);
pango_font_description_set_weight(desc, get_pango_weight(table->usWeightClass));
pango_font_description_set_stretch(desc, get_pango_stretch(table->usWidthClass));
Expand Down

0 comments on commit 9b9be4f

Please sign in to comment.