Ticket #33711: patch-src_type1_t1load.c.diff

File patch-src_type1_t1load.c.diff, 2.6 KB (added by florian@…, 12 years ago)

Patchfile

  • src/type1/t1load.c

    old new  
    7171#include "t1errors.h"
    7272
    7373
     74#ifdef FT_CONFIG_OPTION_INCREMENTAL
     75#define IS_INCREMENTAL  ( face->root.internal->incremental_interface != 0 )
     76#else
     77#define IS_INCREMENTAL  0
     78#endif
     79
     80
    7481  /*************************************************************************/
    7582  /*                                                                       */
    7683  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
     
    10301037  static int
    10311038  read_binary_data( T1_Parser  parser,
    10321039                    FT_Long*   size,
    1033                     FT_Byte**  base )
     1040                    FT_Byte**  base,
     1041                    FT_Bool    incremental )
    10341042  {
    10351043    FT_Byte*  cur;
    10361044    FT_Byte*  limit = parser->root.limit;
     
    10651073      }
    10661074    }
    10671075
    1068     FT_ERROR(( "read_binary_data: invalid size field\n" ));
    1069     parser->root.error = T1_Err_Invalid_File_Format;
     1076    if( !incremental )
     1077    {
     1078      FT_ERROR(( "read_binary_data: invalid size field\n" ));
     1079      parser->root.error = T1_Err_Invalid_File_Format;
     1080    }
     1081
    10701082    return 0;
    10711083  }
    10721084
     
    13961408
    13971409      idx = T1_ToInt( parser );
    13981410
    1399       if ( !read_binary_data( parser, &size, &base ) )
     1411      if ( !read_binary_data( parser, &size, &base, IS_INCREMENTAL ) )
    14001412        return;
    14011413
    14021414      /* The binary string is followed by one token, e.g. `NP' */
     
    15821594        cur++;                              /* skip `/' */
    15831595        len = parser->root.cursor - cur;
    15841596
    1585         if ( !read_binary_data( parser, &size, &base ) )
     1597        if ( !read_binary_data( parser, &size, &base, IS_INCREMENTAL ) )
    15861598          return;
    15871599
    15881600        /* for some non-standard fonts like `Optima' which provides */
     
    18711883
    18721884
    18731885        parser->root.cursor = start_binary;
    1874         if ( !read_binary_data( parser, &s, &b ) )
     1886        if ( !read_binary_data( parser, &s, &b, IS_INCREMENTAL ) )
    18751887          return T1_Err_Invalid_File_Format;
    18761888        have_integer = 0;
    18771889      }
     
    18841896
    18851897
    18861898        parser->root.cursor = start_binary;
    1887         if ( !read_binary_data( parser, &s, &b ) )
     1899        if ( !read_binary_data( parser, &s, &b, IS_INCREMENTAL ) )
    18881900          return T1_Err_Invalid_File_Format;
    18891901        have_integer = 0;
    18901902      }
     
    21602172      type1->subrs_len   = loader.subrs.lengths;
    21612173    }
    21622174
    2163 #ifdef FT_CONFIG_OPTION_INCREMENTAL
    2164     if ( !face->root.internal->incremental_interface )
    2165 #endif
     2175    if ( !IS_INCREMENTAL )
    21662176      if ( !loader.charstrings.init )
    21672177      {
    21682178        FT_ERROR(( "T1_Open_Face: no `/CharStrings' array in face\n" ));