[pango] Fix a crash with line break control



commit cc98d82901753e930f45fc94c5a28fd2a96f6857
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jul 27 13:03:52 2019 -0400

    Fix a crash with line break control
    
    We were forgetting to copy allow-break attributes,
    causing them to be prematurely freed. Oops.

 pango/break.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/pango/break.c b/pango/break.c
index 356c5afe..abaf7d9b 100644
--- a/pango/break.c
+++ b/pango/break.c
@@ -1921,7 +1921,7 @@ break_attrs (const char   *text,
       PangoAttribute *attr = l->data;
 
       if (attr->klass->type == PANGO_ATTR_ALLOW_BREAKS)
-        pango_attr_list_insert (list, (PangoAttribute*)l->data);
+        pango_attr_list_insert (list, pango_attribute_copy (attr));
     }
 
   iter = pango_attr_list_get_iterator (list);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]