From 6342da9a8d518544ad590b887a21c122c10f8773 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Mon, 20 Mar 2017 05:36:41 +0100 Subject: [PATCH] [sfnt] Don't add instances to non-variation fonts. * src/sfnt/sfobjs.c (sfnt_init_face): Fix it. --- ChangeLog | 6 ++++++ src/sfnt/sfobjs.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 04a1932a7..74ce79529 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2017-03-20 Werner Lemberg + + [sfnt] Don't add instances to non-variation fonts. + + * src/sfnt/sfobjs.c (sfnt_init_face): Fix it. + 2017-03-20 Werner Lemberg * src/cff/cffgload.c (cff_builder_init): Add safety guard (#50578). diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c index 0418d83ca..d3de9fcb3 100644 --- a/src/sfnt/sfobjs.c +++ b/src/sfnt/sfobjs.c @@ -1012,8 +1012,9 @@ * later on. Here, we have to adjust `num_instances' accordingly. */ - if ( !( FT_ALLOC( default_values, num_axes * 2 ) || - FT_ALLOC( instance_values, num_axes * 2 ) ) ) + if ( ( face->variation_support & TT_FACE_FLAG_VAR_FVAR ) && + !( FT_ALLOC( default_values, num_axes * 2 ) || + FT_ALLOC( instance_values, num_axes * 2 ) ) ) { /* the current stream position is 16 bytes after the table start */ FT_ULong array_start = FT_STREAM_POS() - 16 + offset;