diff --git a/src/OT/glyf/glyf.hh b/src/OT/glyf/glyf.hh index 84d57ae3a..60a253b3c 100644 --- a/src/OT/glyf/glyf.hh +++ b/src/OT/glyf/glyf.hh @@ -98,7 +98,9 @@ struct glyf use_short_loca = max_offset < 0x1FFFF; } - glyf_prime->serialize (c->serializer, glyphs.writer (), use_short_loca, c->plan, font); + if (!glyf_prime->serialize (c->serializer, glyphs.writer (), use_short_loca, c->plan, font)) + return false; + if (!use_short_loca) { padded_offsets = + hb_iter (glyphs) diff --git a/src/hb-limits.hh b/src/hb-limits.hh index 192b77416..0f60e9e21 100644 --- a/src/hb-limits.hh +++ b/src/hb-limits.hh @@ -90,7 +90,7 @@ #ifndef HB_GLYF_MAX_POINTS -#define HB_GLYF_MAX_POINTS 10000 +#define HB_GLYF_MAX_POINTS 20000 #endif #ifndef HB_GLYF_MAX_EDGE_COUNT diff --git a/test/subset/data/Makefile.am b/test/subset/data/Makefile.am index e6d2325ee..736a07f49 100644 --- a/test/subset/data/Makefile.am +++ b/test/subset/data/Makefile.am @@ -60,6 +60,7 @@ EXTRA_DIST += \ expected/instance_feature_variations \ expected/instantiate_glyf \ expected/pin_all_at_default \ + expected/instance_no_double_free \ fonts \ profiles \ $(NULL) diff --git a/test/subset/data/Makefile.sources b/test/subset/data/Makefile.sources index 845a77e73..6681006da 100644 --- a/test/subset/data/Makefile.sources +++ b/test/subset/data/Makefile.sources @@ -51,6 +51,7 @@ TESTS = \ tests/instance_feature_variations.tests \ tests/instantiate_glyf.tests \ tests/pin_all_at_default.tests \ + tests/instance_no_double_free.tests \ $(NULL) # TODO: re-enable once colrv1 subsetting is stabilized. diff --git a/test/subset/data/expected/instance_no_double_free/Handjet.notdef-outline.retain-all-codepoint.wght=100,ELGR=1,ELSH=2.ttf b/test/subset/data/expected/instance_no_double_free/Handjet.notdef-outline.retain-all-codepoint.wght=100,ELGR=1,ELSH=2.ttf new file mode 100644 index 000000000..ca588d130 Binary files /dev/null and b/test/subset/data/expected/instance_no_double_free/Handjet.notdef-outline.retain-all-codepoint.wght=100,ELGR=1,ELSH=2.ttf differ diff --git a/test/subset/data/fonts/Handjet.ttf b/test/subset/data/fonts/Handjet.ttf new file mode 100644 index 000000000..66f4d508e Binary files /dev/null and b/test/subset/data/fonts/Handjet.ttf differ diff --git a/test/subset/data/tests/instance_no_double_free.tests b/test/subset/data/tests/instance_no_double_free.tests new file mode 100644 index 000000000..6be859791 --- /dev/null +++ b/test/subset/data/tests/instance_no_double_free.tests @@ -0,0 +1,11 @@ +FONTS: +Handjet.ttf + +PROFILES: +notdef-outline.txt + +SUBSETS: +* + +INSTANCES: +wght=100,ELGR=1,ELSH=2 diff --git a/test/subset/meson.build b/test/subset/meson.build index 77a2029d7..e35ffec8c 100644 --- a/test/subset/meson.build +++ b/test/subset/meson.build @@ -53,6 +53,7 @@ tests = [ 'instantiate_glyf', 'full_instance', 'instance_feature_variations', + 'instance_no_double_free', ] repack_tests = [