[cff, truetype] Remove compiler warnings; fix `make multi'.

* src/cff/cf2font.h: Include `cffload.h'.

* src/cff/cffload.c: Include FT_MULTIPLE_MASTERS_H and
FT_SERVICE_MULTIPLE_MASTERS_H.
(cff_vstore_load): Eliminate `vsSize'.
(cff_load_private_dict): Tag as `FT_LOCAL_DEF'.

* src/cff/cffload.h: Include `cffobjs.h'.
Provide declaration for `cff_load_private_dict'.

* src/truetype/ttgxvar.c (ft_var_load_hvar): Eliminate
`minorVersion' and `map_offset'.
Harmony
Werner Lemberg 8 years ago
parent beecf80a6d
commit 6862024854
  1. 17
      ChangeLog
  2. 1
      src/cff/cf2font.h
  3. 13
      src/cff/cffload.c
  4. 7
      src/cff/cffload.h
  5. 8
      src/truetype/ttgxvar.c

@ -1,3 +1,20 @@
2016-12-16 Werner Lemberg <wl@gnu.org>
[cff, truetype] Remove compiler warnings; fix `make multi'.
* src/cff/cf2font.h: Include `cffload.h'.
* src/cff/cffload.c: Include FT_MULTIPLE_MASTERS_H and
FT_SERVICE_MULTIPLE_MASTERS_H.
(cff_vstore_load): Eliminate `vsSize'.
(cff_load_private_dict): Tag as `FT_LOCAL_DEF'.
* src/cff/cffload.h: Include `cffobjs.h'.
Provide declaration for `cff_load_private_dict'.
* src/truetype/ttgxvar.c (ft_var_load_hvar): Eliminate
`minorVersion' and `map_offset'.
2016-12-16 Werner Lemberg <wl@gnu.org>
[cff] Fix heap buffer overflow (#49858).

@ -42,6 +42,7 @@
#include "cf2ft.h"
#include "cf2blues.h"
#include "cffload.h"
FT_BEGIN_HEADER

@ -23,6 +23,11 @@
#include FT_TRUETYPE_TAGS_H
#include FT_TYPE1_TABLES_H
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
#include FT_MULTIPLE_MASTERS_H
#include FT_SERVICE_MULTIPLE_MASTERS_H
#endif
#include "cffload.h"
#include "cffparse.h"
@ -1126,15 +1131,15 @@
/* no offset means no vstore to parse */
if ( offset )
{
FT_UInt vsSize; /* currently unused */
FT_UInt vsOffset;
FT_UInt format;
FT_ULong regionListOffset;
/* we need to parse the table to determine its size */
/* we need to parse the table to determine its size; */
/* skip table length */
if ( FT_STREAM_SEEK( base_offset + offset ) ||
FT_READ_USHORT( vsSize ) )
FT_STREAM_SKIP( 2 ) )
goto Exit;
/* actual variation store begins after the length */
@ -1824,7 +1829,7 @@
/* so NDV has not been set for CFF2 variation. */
/* */
/* `cff_slot_load' must call this function each time NDV changes. */
static FT_Error
FT_LOCAL_DEF( FT_Error )
cff_load_private_dict( CFF_Font font,
CFF_SubFont subfont,
FT_UInt lenNDV,

@ -23,6 +23,7 @@
#include <ft2build.h>
#include "cfftypes.h"
#include "cffparse.h"
#include "cffobjs.h" /* for CFF_Face */
FT_BEGIN_HEADER
@ -72,6 +73,12 @@ FT_BEGIN_HEADER
cff_font_done( CFF_Font font );
FT_LOCAL( FT_Error )
cff_load_private_dict( CFF_Font font,
CFF_SubFont subfont,
FT_UInt lenNDV,
FT_Fixed* NDV );
FT_LOCAL( FT_Byte )
cff_fd_select_get( CFF_FDSelect fdselect,
FT_UInt glyph_index );

@ -433,11 +433,9 @@
FT_Error error;
FT_UShort majorVersion;
FT_UShort minorVersion;
FT_ULong table_len;
FT_ULong table_offset;
FT_ULong store_offset;
FT_ULong map_offset;
FT_ULong* dataOffsetArray = NULL;
@ -455,8 +453,9 @@
table_offset = FT_STREAM_POS();
/* skip minor version */
if ( FT_READ_USHORT( majorVersion ) ||
FT_READ_USHORT( minorVersion ) )
FT_STREAM_SKIP( 2 ) )
goto Exit;
if ( majorVersion != 1 )
{
@ -465,8 +464,9 @@
goto Exit;
}
/* skip map offset */
if ( FT_READ_ULONG( store_offset ) ||
FT_READ_ULONG( map_offset ) )
FT_STREAM_SKIP( 4 ) )
goto Exit;
/* parse item variation store */

Loading…
Cancel
Save