summaryrefslogtreecommitdiff
path: root/src/sfnt/ttpost.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sfnt/ttpost.c')
-rw-r--r--src/sfnt/ttpost.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/sfnt/ttpost.c b/src/sfnt/ttpost.c
index 3277f1e..540d5f2 100644
--- a/src/sfnt/ttpost.c
+++ b/src/sfnt/ttpost.c
@@ -5,7 +5,7 @@
/* PostScript name table processing for TrueType and OpenType fonts */
/* (body). */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -29,6 +29,10 @@
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
#include FT_TRUETYPE_TAGS_H
+
+
+#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
+
#include "ttpost.h"
#include "sferrors.h"
@@ -326,7 +330,9 @@
goto Exit;
/* check the number of glyphs */
- if ( num_glyphs > face->max_profile.numGlyphs || num_glyphs > 258 )
+ if ( num_glyphs > face->max_profile.numGlyphs ||
+ num_glyphs > 258 ||
+ num_glyphs < 1 )
{
error = FT_THROW( Invalid_File_Format );
goto Exit;
@@ -559,5 +565,12 @@
return FT_Err_Ok;
}
+#else /* !TT_CONFIG_OPTION_POSTSCRIPT_NAMES */
+
+ /* ANSI C doesn't like empty source files */
+ typedef int _tt_post_dummy;
+
+#endif /* !TT_CONFIG_OPTION_POSTSCRIPT_NAMES */
+
/* END */