Commit 09c5fcc3 authored by Massimo Valentini's avatar Massimo Valentini
Browse files

Bug 742775: Crash when editing text with certain fonts

parent 3756df29
......@@ -827,6 +827,10 @@ gimp_text_buffer_get_font_tag (GimpTextBuffer *buffer,
GList *list;
GtkTextTag *tag;
gchar name[256];
PangoFontDescription *pfd = pango_font_description_from_string (font);
char *description = pango_font_description_to_string (pfd);
pango_font_description_free (pfd);
for (list = buffer->font_tags; list; list = g_list_next (list))
......@@ -836,22 +840,23 @@ gimp_text_buffer_get_font_tag (GimpTextBuffer *buffer,
tag_font = gimp_text_tag_get_font (tag);
if (! strcmp (font, tag_font))
if (! strcmp (description, tag_font))
g_free (tag_font);
g_free (description);
return tag;
g_free (tag_font);
g_snprintf (name, sizeof (name), "font-%s", font);
g_snprintf (name, sizeof (name), "font-%s", description);
tag = gtk_text_buffer_create_tag (GTK_TEXT_BUFFER (buffer),
"font", font,
"font", description,
g_free (description);
buffer->font_tags = g_list_prepend (buffer->font_tags, tag);
return tag;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment