summaryrefslogtreecommitdiff
path: root/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset.cc
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset.cc')
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset.cc
index 6235a5bf531..ec2f8892fde 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-subset.cc
@@ -82,6 +82,7 @@ _subset2 (hb_subset_plan_t *plan)
if (unlikely (!buf.alloc (buf_size)))
{
DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c failed to allocate %u bytes.", HB_UNTAG (tag), buf_size);
+ hb_blob_destroy (source_blob);
return false;
}
retry:
@@ -96,6 +97,7 @@ _subset2 (hb_subset_plan_t *plan)
if (unlikely (!buf.alloc (buf_size)))
{
DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c failed to reallocate %u bytes.", HB_UNTAG (tag), buf_size);
+ hb_blob_destroy (source_blob);
return false;
}
goto retry;
@@ -283,17 +285,19 @@ hb_subset (hb_face_t *source,
hb_tag_t table_tags[32];
unsigned int offset = 0, count;
bool success = true;
+ hb_set_t tags_set;
do {
count = ARRAY_LENGTH (table_tags);
hb_face_get_table_tags (source, offset, &count, table_tags);
for (unsigned int i = 0; i < count; i++)
{
hb_tag_t tag = table_tags[i];
- if (_should_drop_table (plan, tag))
+ if (_should_drop_table (plan, tag) && !tags_set.has (tag))
{
DEBUG_MSG(SUBSET, nullptr, "drop %c%c%c%c", HB_UNTAG (tag));
continue;
}
+ tags_set.add (tag);
success = success && _subset_table (plan, tag);
}
offset += count;