diff options
author | Kristian Rietveld <kris@lanedo.com> | 2012-03-18 10:40:50 +0100 |
---|---|---|
committer | Kristian Rietveld <kris@lanedo.com> | 2012-03-18 10:41:41 +0100 |
commit | 4ed7cd1a9e61f969bcdb616a5ba9a1290b7e43b4 (patch) | |
tree | 18b083ab3bead06c0ef3a51c6b75518dc6c3ccbb /modules | |
parent | ded299c755fd472bc0eb19789a1f40ab4d61a098 (diff) | |
download | pango-4ed7cd1a9e61f969bcdb616a5ba9a1290b7e43b4.tar.gz |
Guard for an accumulated glyph count of zero in CoreText shape engine
Diffstat (limited to 'modules')
-rw-r--r-- | modules/basic/basic-coretext.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/basic/basic-coretext.c b/modules/basic/basic-coretext.c index baacec61..edbef40f 100644 --- a/modules/basic/basic-coretext.c +++ b/modules/basic/basic-coretext.c @@ -225,7 +225,15 @@ run_iterator_create (struct RunIterator *iter, iter->total_ct_i = 0; iter->glyph_count = run_iterator_get_glyph_count (iter); - run_iterator_set_current_run (iter, 0); + + /* If CoreText did not render any glyphs for this string (can happen, + * e.g. a run solely consisting of a BOM), glyph_count will be zero and + * we immediately set the iterator variable to indicate end of glyph list. + */ + if (iter->glyph_count > 0) + run_iterator_set_current_run (iter, 0); + else + iter->total_ct_i = -1; } static void |