diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2015-09-01 16:40:34 +0100 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2015-09-01 16:40:34 +0100 |
commit | 3f58b49182a117caadc0fcddeff39ce29ca8d397 (patch) | |
tree | 54f5c1c4f3d56513a03274a68550855702aaa06c /pango/pango-glyph-item.c | |
parent | ec00fb5d78cd9ba996859db924119ffaa54938e0 (diff) | |
download | pango-3f58b49182a117caadc0fcddeff39ce29ca8d397.tar.gz |
Protect against bugs in HarfBuzz's (non-)monotone cluster values
"Fixes" https://bugzilla.gnome.org/show_bug.cgi?id=541608
Real fix went to HarfBuzz.
Diffstat (limited to 'pango/pango-glyph-item.c')
-rw-r--r-- | pango/pango-glyph-item.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pango/pango-glyph-item.c b/pango/pango-glyph-item.c index 8c2cb4e2..586b23ba 100644 --- a/pango/pango-glyph-item.c +++ b/pango/pango-glyph-item.c @@ -281,7 +281,7 @@ pango_glyph_item_iter_next_cluster (PangoGlyphItemIter *iter) break; } - if (glyphs->log_clusters[glyph_index] != cluster) + if (glyphs->log_clusters[glyph_index] > cluster) { iter->end_index = item->offset + glyphs->log_clusters[glyph_index]; iter->end_char += pango_utf8_strlen (iter->text + iter->start_index, @@ -304,7 +304,7 @@ pango_glyph_item_iter_next_cluster (PangoGlyphItemIter *iter) break; } - if (glyphs->log_clusters[glyph_index] != cluster) + if (glyphs->log_clusters[glyph_index] > cluster) { iter->end_index = item->offset + glyphs->log_clusters[glyph_index]; iter->end_char += pango_utf8_strlen (iter->text + iter->start_index, @@ -372,7 +372,7 @@ pango_glyph_item_iter_prev_cluster (PangoGlyphItemIter *iter) glyph_index--; - if (glyphs->log_clusters[glyph_index] != cluster) + if (glyphs->log_clusters[glyph_index] < cluster) { glyph_index++; iter->start_index = item->offset + glyphs->log_clusters[glyph_index]; @@ -396,7 +396,7 @@ pango_glyph_item_iter_prev_cluster (PangoGlyphItemIter *iter) glyph_index++; - if (glyphs->log_clusters[glyph_index] != cluster) + if (glyphs->log_clusters[glyph_index] < cluster) { glyph_index--; iter->start_index = item->offset + glyphs->log_clusters[glyph_index]; |