summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/type1/t1parse.c
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2013-03-26 08:57:05 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-01 12:03:55 +0200
commit6845a4fb0147117e8517d66f18792ca7acdbe06e (patch)
tree68e35417b79989a7af8a4ea8c0d282b84dbe0a6e /src/3rdparty/freetype/src/type1/t1parse.c
parent0fcadcca3d0842354de07ffaa8c622e607aab22c (diff)
Update bundled FreeType sources to 2.3.12
Most important changes: * SFNT cmap 13 table format support; * fixed glitches when rasterizing stretched TTF (xsize!=ysize); * various fixes in Type1, CFF, and PCF drivers Change-Id: Ib9e2210ffbd0daa2fdbf518ea87f4be502de6b48 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/3rdparty/freetype/src/type1/t1parse.c')
-rw-r--r--src/3rdparty/freetype/src/type1/t1parse.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/src/3rdparty/freetype/src/type1/t1parse.c b/src/3rdparty/freetype/src/type1/t1parse.c
index 36f5c82c86..2a762279fd 100644
--- a/src/3rdparty/freetype/src/type1/t1parse.c
+++ b/src/3rdparty/freetype/src/type1/t1parse.c
@@ -4,7 +4,7 @@
/* */
/* Type 1 parser (body). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2008 by */
+/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -35,7 +35,6 @@
#include <ft2build.h>
#include FT_INTERNAL_DEBUG_H
-#include FT_INTERNAL_CALC_H
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_POSTSCRIPT_AUX_H
@@ -298,8 +297,8 @@
/* and allocate private dictionary buffer */
if ( parser->private_len == 0 )
{
- FT_ERROR(( "T1_Get_Private_Dict:" ));
- FT_ERROR(( " invalid private dictionary section\n" ));
+ FT_ERROR(( "T1_Get_Private_Dict:"
+ " invalid private dictionary section\n" ));
error = T1_Err_Invalid_File_Format;
goto Fail;
}
@@ -354,8 +353,8 @@
cur++;
if ( cur >= limit )
{
- FT_ERROR(( "T1_Get_Private_Dict:" ));
- FT_ERROR(( " could not find `eexec' keyword\n" ));
+ FT_ERROR(( "T1_Get_Private_Dict:"
+ " could not find `eexec' keyword\n" ));
error = T1_Err_Invalid_File_Format;
goto Exit;
}
@@ -398,18 +397,21 @@
T1_Skip_PS_Token( parser );
cur = parser->root.cursor;
- if ( *cur == '\r' )
- {
- cur++;
- if ( *cur == '\n' )
- cur++;
- }
- else if ( *cur == '\n' )
- cur++;
- else
+
+ /* according to the Type1 spec, the first cipher byte must not be */
+ /* an ASCII whitespace character code (blank, tab, carriage return */
+ /* or line feed). We have seen Type 1 fonts with two line feed */
+ /* characters... So skip now all whitespace character codes. */
+ while ( cur < limit &&
+ ( *cur == ' ' ||
+ *cur == '\t' ||
+ *cur == '\r' ||
+ *cur == '\n' ) )
+ ++cur;
+ if ( cur >= limit )
{
- FT_ERROR(( "T1_Get_Private_Dict:" ));
- FT_ERROR(( " `eexec' not properly terminated\n" ));
+ FT_ERROR(( "T1_Get_Private_Dict:"
+ " `eexec' not properly terminated\n" ));
error = T1_Err_Invalid_File_Format;
goto Exit;
}