[pango/wip/baedert/for-master: 51/53] pango-layout: Help static analysis a bit



commit dc5e67b2d74386f6482f6b978f972c4bfd8401cf
Author: Timm Bäder <mail baedert org>
Date:   Wed Jun 10 05:54:01 2020 +0200

    pango-layout: Help static analysis a bit
    
    Make sure we have a valid iter here, which is of course always the case
    in reality.

 pango/pango-layout.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 6d4d94cb..97e24d1b 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -2090,6 +2090,8 @@ pango_layout_xy_to_index (PangoLayout *layout,
       PangoRectangle line_logical;
       int first_y, last_y;
 
+      g_assert (!ITER_IS_INVALID (&iter));
+
       pango_layout_iter_get_line_extents (&iter, NULL, &line_logical);
       pango_layout_iter_get_line_yrange (&iter, &first_y, &last_y);
 


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