[pango/matthiasc/for-main: 14/14] layout: Fix static analysis warnings




commit 1f6bd846b6b2cf242e1af263963544bf4e4a5054
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Sep 17 19:36:46 2021 -0400

    layout: Fix static analysis warnings
    
    These were showing up as warnings about garbage
    values in the gtk static-scan build.

 pango/pango-layout.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 21e2c9c6..74799ddc 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -2387,8 +2387,8 @@ pango_layout_index_to_pos (PangoLayout    *layout,
                            int             index,
                            PangoRectangle *pos)
 {
-  PangoRectangle line_logical_rect;
-  PangoRectangle run_logical_rect;
+  PangoRectangle line_logical_rect = { 0, };
+  PangoRectangle run_logical_rect = { 0, };
   PangoLayoutIter iter;
   PangoLayoutLine *layout_line = NULL;
   int x_pos;
@@ -4480,8 +4480,8 @@ pango_layout_check_lines (PangoLayout *layout)
   state.line_height = -1;
   if (layout->height >= 0)
     {
-      PangoRectangle logical;
-      int height;
+      PangoRectangle logical = { 0, };
+      int height = 0;
       pango_layout_get_empty_extents_and_height_at_index (layout, 0, &logical, &height);
       state.line_height = layout->line_spacing == 0.0 ? logical.height : layout->line_spacing * height;
     }


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