[subset] Fail subset if a table fails to sanitize.

This commit is contained in:
Garret Rieger 2018-02-22 11:57:35 -08:00
parent 15fc45bfed
commit ec302ad5bd

View File

@ -84,12 +84,15 @@ static bool
_subset (hb_subset_plan_t *plan)
{
OT::Sanitizer<TableType> sanitizer;
hb_blob_t *source_blob = sanitizer.sanitize (plan->source->reference_table (TableType::tableTag));
const TableType *table = OT::Sanitizer<TableType>::lock_instance (source_blob);
hb_bool_t result = table->subset(plan);
hb_bool_t result = false;
if (table != &OT::Null(TableType))
result = table->subset(plan);
hb_blob_destroy (source_blob);
hb_tag_t tag = TableType::tableTag;
DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c::subset %s", HB_UNTAG(tag), result ? "success" : "FAILED!");
return result;