[pango] Fix an uninitialized value



commit 70965b54ca6d27fe4635c39587cfb951c3657830
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jul 27 09:40:25 2019 -0400

    Fix an uninitialized value
    
    https://gitlab.gnome.org/GNOME/pango/issues/383

 pango/pangofc-font.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/pango/pangofc-font.c b/pango/pangofc-font.c
index 247ea1a0..7d9eb782 100644
--- a/pango/pangofc-font.c
+++ b/pango/pangofc-font.c
@@ -999,26 +999,30 @@ pango_fc_font_create_hb_font (PangoFont *font)
   double x_scale_inv, y_scale_inv;
   double x_scale, y_scale;
   double size;
-  PangoGravity gravity;
 
   x_scale_inv = y_scale_inv = 1.0;
+  size = 1.0;
+
   key = _pango_fc_font_get_font_key (fc_font);
   if (key)
     {
-      const PangoMatrix *matrix = pango_fc_font_key_get_matrix (key);
+      const PangoMatrix *matrix;
+      PangoGravity gravity;
+
+      matrix = pango_fc_font_key_get_matrix (key);
       pango_matrix_get_font_scale_factors (matrix, &x_scale_inv, &y_scale_inv);
+      gravity = pango_fc_font_key_get_gravity (key);
+      if (PANGO_GRAVITY_IS_IMPROPER (gravity))
+        {
+          x_scale_inv = -x_scale_inv;
+          y_scale_inv = -y_scale_inv;
+        }
+      size = get_font_size (key);
     }
-  if (PANGO_GRAVITY_IS_IMPROPER (gravity))
-  {
-    x_scale_inv = -x_scale_inv;
-    y_scale_inv = -y_scale_inv;
-  }
 
   x_scale = 1. / x_scale_inv;
   y_scale = 1. / y_scale_inv;
 
-  size = get_font_size (key);
-  gravity = pango_fc_font_key_get_gravity (key);
   hb_face = pango_fc_font_map_get_hb_face (PANGO_FC_FONT_MAP (fc_font->fontmap), fc_font);
 
   hb_font = hb_font_create (hb_face);


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