[sfnt] Fix check for default named instance. * src/sfnt/sfobjs.c (sfnt_init_face): A `fixed' number needs four bytes, not two...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
diff --git a/ChangeLog b/ChangeLog
index f344092..a98267a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2017-03-23 Werner Lemberg <wl@gnu.org>
+ [sfnt] Fix check for default named instance.
+
+ * src/sfnt/sfobjs.c (sfnt_init_face): A `fixed' number needs four
+ bytes, not two...
+
+2017-03-23 Werner Lemberg <wl@gnu.org>
+
Make MM fonts work (again).
* src/base/ftmm.c (FT_Set_Var_Design_Coordinates,
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index d3de9fc..ac2e620 100644
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -1013,8 +1013,8 @@
*/
if ( ( face->variation_support & TT_FACE_FLAG_VAR_FVAR ) &&
- !( FT_ALLOC( default_values, num_axes * 2 ) ||
- FT_ALLOC( instance_values, num_axes * 2 ) ) )
+ !( FT_ALLOC( default_values, num_axes * 4 ) ||
+ FT_ALLOC( instance_values, num_axes * 4 ) ) )
{
/* the current stream position is 16 bytes after the table start */
FT_ULong array_start = FT_STREAM_POS() - 16 + offset;
@@ -1029,10 +1029,10 @@
for ( i = 0; i < num_axes; i++ )
{
- (void)FT_STREAM_READ_AT( default_value_offset, p, 2 );
+ (void)FT_STREAM_READ_AT( default_value_offset, p, 4 );
default_value_offset += axis_size;
- p += 2;
+ p += 4;
}
instance_offset = array_start + axis_size * num_axes + 4;
@@ -1041,9 +1041,9 @@
{
(void)FT_STREAM_READ_AT( instance_offset,
instance_values,
- num_axes * 2 );
+ num_axes * 4 );
- if ( !ft_memcmp( default_values, instance_values, num_axes * 2 ) )
+ if ( !ft_memcmp( default_values, instance_values, num_axes * 4 ) )
break;
instance_offset += instance_size;