summaryrefslogtreecommitdiff
path: root/pango/pango-coverage.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-07-12 18:37:35 -0400
committerMatthias Clasen <mclasen@redhat.com>2019-07-12 18:37:35 -0400
commit0c1df3edb3a7aee3aef71c39db806194e8cb5b31 (patch)
tree491f9486cd61bd6ca48e105176ca17bf436946e3 /pango/pango-coverage.c
parent54135c8e7abe614a5e9a0cecb51a7203be63459e (diff)
downloadpango-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.c10
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;
}