diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-07-12 18:37:35 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-07-12 18:37:35 -0400 |
commit | 0c1df3edb3a7aee3aef71c39db806194e8cb5b31 (patch) | |
tree | 491f9486cd61bd6ca48e105176ca17bf436946e3 /pango/pango-coverage.c | |
parent | 54135c8e7abe614a5e9a0cecb51a7203be63459e (diff) | |
download | pango-0c1df3edb3a7aee3aef71c39db806194e8cb5b31.tar.gz |
coverage: Fix the implementation
We never created the set. Oops.
Diffstat (limited to 'pango/pango-coverage.c')
-rw-r--r-- | pango/pango-coverage.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/pango/pango-coverage.c b/pango/pango-coverage.c index 41943720..7f18b583 100644 --- a/pango/pango-coverage.c +++ b/pango/pango-coverage.c @@ -56,6 +56,9 @@ static PangoCoverageLevel pango_coverage_real_get (PangoCoverage *coverage, int index) { + if (coverage->chars == NULL) + return PANGO_COVERAGE_NONE; + if (hb_set_has (coverage->chars, (hb_codepoint_t)index)) return PANGO_COVERAGE_EXACT; else @@ -67,6 +70,9 @@ pango_coverage_real_set (PangoCoverage *coverage, int index, PangoCoverageLevel level) { + if (coverage->chars == NULL) + coverage->chars = hb_set_create (); + if (level != PANGO_COVERAGE_NONE) hb_set_add (coverage->chars, (hb_codepoint_t)index); else @@ -81,8 +87,8 @@ pango_coverage_real_copy (PangoCoverage *coverage) g_return_val_if_fail (coverage != NULL, NULL); copy = g_object_new (PANGO_TYPE_COVERAGE, NULL); - hb_set_destroy (copy->chars); - copy->chars = hb_set_reference (coverage->chars); + if (coverage->chars) + copy->chars = hb_set_reference (coverage->chars); return copy; } |