[sfnt] Don't add instances to non-variation fonts.

* src/sfnt/sfobjs.c (sfnt_init_face): Fix it.
This commit is contained in:
Werner Lemberg 2017-03-20 05:36:41 +01:00
parent dd64a6227c
commit 6342da9a8d
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2017-03-20 Werner Lemberg <wl@gnu.org>
[sfnt] Don't add instances to non-variation fonts.
* src/sfnt/sfobjs.c (sfnt_init_face): Fix it.
2017-03-20 Werner Lemberg <wl@gnu.org>
* src/cff/cffgload.c (cff_builder_init): Add safety guard (#50578).

View File

@ -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;