diff --git a/src/graph/coverage-graph.hh b/src/graph/coverage-graph.hh index 5778ee9e1..973f61939 100644 --- a/src/graph/coverage-graph.hh +++ b/src/graph/coverage-graph.hh @@ -32,23 +32,25 @@ namespace graph { +template static bool sanitize ( - const OT::Layout::Common::CoverageFormat1_3* thiz, + const OT::Layout::Common::CoverageFormat1_3* thiz, graph_t::vertex_t& vertex ) { size_t vertex_len = vertex.obj.tail - vertex.obj.head; - constexpr unsigned min_size = OT::Layout::Common::CoverageFormat1_3::min_size; + constexpr unsigned min_size = OT::Layout::Common::CoverageFormat1_3::min_size; if (vertex_len < min_size) return false; hb_barrier (); return vertex_len >= min_size + thiz->glyphArray.get_size () - thiz->glyphArray.len.get_size (); } +template static bool sanitize ( - const OT::Layout::Common::CoverageFormat2_4* thiz, + const OT::Layout::Common::CoverageFormat2_4* thiz, graph_t::vertex_t& vertex ) { size_t vertex_len = vertex.obj.tail - vertex.obj.head; - constexpr unsigned min_size = OT::Layout::Common::CoverageFormat2_4::min_size; + constexpr unsigned min_size = OT::Layout::Common::CoverageFormat2_4::min_size; if (vertex_len < min_size) return false; hb_barrier (); return vertex_len >= min_size + thiz->rangeRecord.get_size () - thiz->rangeRecord.len.get_size (); @@ -166,9 +168,8 @@ struct Coverage : public OT::Layout::Common::Coverage case 1: return graph::sanitize ((const OT::Layout::Common::CoverageFormat1_3*) this, vertex); case 2: return graph::sanitize ((const OT::Layout::Common::CoverageFormat2_4*) this, vertex); #ifndef HB_NO_BEYOND_64K - // Not currently supported - case 3: - case 4: + case 3: return graph::sanitize ((const OT::Layout::Common::CoverageFormat1_3*) this, vertex); + case 4: return graph::sanitize ((const OT::Layout::Common::CoverageFormat2_4*) this, vertex); #endif default: return false; }