[pango/pango-1-48: 6/7] Be more careful about analysis->font




commit 17247f28413e4a3fb9386da60ba7b88da1507904
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Aug 11 19:00:06 2021 -0700

    Be more careful about analysis->font
    
    This might be NULL, and we want to stumble
    on in that case. See #592.

 pango/shape.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/pango/shape.c b/pango/shape.c
index b870ecad..401c9ec1 100644
--- a/pango/shape.c
+++ b/pango/shape.c
@@ -174,8 +174,9 @@ struct _PangoFcFont
 typedef struct _PangoFcFont PangoFcFont;
 
 #define PANGO_IS_FC_FONT(obj) \
-  g_type_is_a (((GTypeInstance*)obj)->g_class->g_type, \
-               g_type_from_name ("PangoFcFont"))
+  ((obj) != NULL && \
+   g_type_is_a (((GTypeInstance*)(obj))->g_class->g_type, \
+                g_type_from_name ("PangoFcFont")))
 
 /**
  * pango_shape_with_flags:


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