[truetype] Minor updates for OpenType 1.8.1.

* src/truetype/ttgxvar.h (GX_MVarTable): `axisCount' has been
removed frem the specification; it is now reserved.

* src/truetype/ttgxvar.c (ft_var_load_mvar): Updated.
(GX_FVar_Head): Remove `countSizePairs'; the corresponding data
field in the `MVAR' table is now reserved.
(fvar_fields): Updated.
This commit is contained in:
Werner Lemberg 2017-01-23 11:47:40 +01:00
parent 79d52b9a8d
commit f502092bcd
3 changed files with 21 additions and 16 deletions

View File

@ -1,3 +1,15 @@
2017-01-23 Werner Lemberg <wl@gnu.org>
[truetype] Minor updates for OpenType 1.8.1.
* src/truetype/ttgxvar.h (GX_MVarTable): `axisCount' has been
removed frem the specification; it is now reserved.
* src/truetype/ttgxvar.c (ft_var_load_mvar): Updated.
(GX_FVar_Head): Remove `countSizePairs'; the corresponding data
field in the `MVAR' table is now reserved.
(fvar_fields): Updated.
2017-01-23 Werner Lemberg <wl@gnu.org>
[truetype] Avoid segfault for invalid variation data.

View File

@ -22,10 +22,6 @@
/* */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6[fgca]var.html */
/* */
/* The documentation for `fvar' is inconsistent. At one point it says */
/* that `countSizePairs' should be 3, at another point 2. It should */
/* be 2. */
/* */
/* The documentation for `gvar' is not intelligible; `cvar' refers you */
/* to `gvar' and is thus also incomprehensible. */
/* */
@ -1119,9 +1115,8 @@
if ( FT_NEW( blend->mvar_table ) )
return;
/* skip value record size */
if ( FT_READ_USHORT( blend->mvar_table->axisCount ) ||
FT_STREAM_SKIP( 2 ) ||
/* skip reserved entry and value record size */
if ( FT_STREAM_SKIP( 4 ) ||
FT_READ_USHORT( blend->mvar_table->valueCount ) ||
FT_READ_USHORT( store_offset ) )
return;
@ -1613,7 +1608,6 @@
{
FT_Long version;
FT_UShort offsetToData;
FT_UShort countSizePairs;
FT_UShort axisCount;
FT_UShort axisSize;
FT_UShort instanceCount;
@ -1680,13 +1674,13 @@
#define FT_STRUCTURE GX_FVar_Head
FT_FRAME_START( 16 ),
FT_FRAME_LONG ( version ),
FT_FRAME_USHORT( offsetToData ),
FT_FRAME_USHORT( countSizePairs ),
FT_FRAME_USHORT( axisCount ),
FT_FRAME_USHORT( axisSize ),
FT_FRAME_USHORT( instanceCount ),
FT_FRAME_USHORT( instanceSize ),
FT_FRAME_LONG ( version ),
FT_FRAME_USHORT ( offsetToData ),
FT_FRAME_SKIP_SHORT,
FT_FRAME_USHORT ( axisCount ),
FT_FRAME_USHORT ( axisSize ),
FT_FRAME_USHORT ( instanceCount ),
FT_FRAME_USHORT ( instanceSize ),
FT_FRAME_END
};

View File

@ -194,7 +194,6 @@ FT_BEGIN_HEADER
/* */
typedef struct GX_MVarTableRec_
{
FT_UShort axisCount;
FT_UShort valueCount;
GX_ItemVarStoreRec itemStore; /* Item Variation Store */