From 40a96ff4cb86ebcd7a9025ed73b5c754a9d314c8 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 1 Sep 2015 13:31:32 +0100 Subject: Add assertion to glyph-item-iter Part of https://bugzilla.gnome.org/show_bug.cgi?id=541608 --- pango/pango-glyph-item.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pango/pango-glyph-item.c b/pango/pango-glyph-item.c index 6954ed86..8c2cb4e2 100644 --- a/pango/pango-glyph-item.c +++ b/pango/pango-glyph-item.c @@ -315,6 +315,10 @@ pango_glyph_item_iter_next_cluster (PangoGlyphItemIter *iter) } iter->end_glyph = glyph_index; + + g_assert (iter->start_char < iter->end_char); + g_assert (iter->end_char <= item->num_chars); + return TRUE; } @@ -404,6 +408,10 @@ pango_glyph_item_iter_prev_cluster (PangoGlyphItemIter *iter) } iter->start_glyph = glyph_index; + + g_assert (iter->start_char < iter->end_char); + g_assert (0 <= iter->start_char); + return TRUE; } -- cgit v1.2.1