[pango] Add assertion to glyph-item-iter
- From: Behdad Esfahbod <behdad src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [pango] Add assertion to glyph-item-iter
- Date: Tue,  1 Sep 2015 16:00:22 +0000 (UTC)
commit 40a96ff4cb86ebcd7a9025ed73b5c754a9d314c8
Author: Behdad Esfahbod <behdad behdad org>
Date:   Tue Sep 1 13:31:32 2015 +0100
    Add assertion to glyph-item-iter
    
    Part of https://bugzilla.gnome.org/show_bug.cgi?id=541608
 pango/pango-glyph-item.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/pango/pango-glyph-item.c b/pango/pango-glyph-item.c
index 6954ed8..8c2cb4e 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;
 }
 
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]