From 3f55e0e74680c246819233a7250df612821698d7 Mon Sep 17 00:00:00 2001 From: Garret Rieger Date: Tue, 20 Mar 2018 17:36:52 -0700 Subject: [PATCH] [subset] Check for the Null table and not nullptr to detect failure to find a table in glyf accelerator. --- src/hb-ot-glyf-table.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hb-ot-glyf-table.hh b/src/hb-ot-glyf-table.hh index 11c3eaac5..79467061f 100644 --- a/src/hb-ot-glyf-table.hh +++ b/src/hb-ot-glyf-table.hh @@ -236,9 +236,9 @@ struct glyf hb_blob_t *head_blob = Sanitizer().sanitize (face->reference_table (HB_OT_TAG_head)); const head *head_table = Sanitizer::lock_instance (head_blob); - if (!head_table || (unsigned int) head_table->indexToLocFormat > 1 || head_table->glyphDataFormat != 0) + if (head_table == &Null(head) || (unsigned int) head_table->indexToLocFormat > 1 || head_table->glyphDataFormat != 0) { - /* Unknown format. Leave num_glyphs=0, that takes care of disabling us. */ + /* head table is not present, or in an unknown format. Leave num_glyphs=0, that takes care of disabling us. */ hb_blob_destroy (head_blob); return; } @@ -268,7 +268,7 @@ struct glyf inline bool get_composite (hb_codepoint_t glyph, CompositeGlyphHeader::Iterator *composite /* OUT */) const { - if (!this->glyf_table || !num_glyphs) + if (this->glyf_table == &Null(glyf) || !num_glyphs) return false; unsigned int start_offset, end_offset;