summaryrefslogtreecommitdiff
path: root/Build/source/texk/lcdf-typetools/libefont
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/lcdf-typetools/libefont')
-rw-r--r--Build/source/texk/lcdf-typetools/libefont/Makefile.in2
-rw-r--r--Build/source/texk/lcdf-typetools/libefont/otfpost.cc12
2 files changed, 10 insertions, 4 deletions
diff --git a/Build/source/texk/lcdf-typetools/libefont/Makefile.in b/Build/source/texk/lcdf-typetools/libefont/Makefile.in
index ad34456c989..080e183c149 100644
--- a/Build/source/texk/lcdf-typetools/libefont/Makefile.in
+++ b/Build/source/texk/lcdf-typetools/libefont/Makefile.in
@@ -52,7 +52,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ac_cxx_template_objs.m4 \
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_HEADER = $(top_builddir)/autoconf.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LIBRARIES = $(noinst_LIBRARIES)
diff --git a/Build/source/texk/lcdf-typetools/libefont/otfpost.cc b/Build/source/texk/lcdf-typetools/libefont/otfpost.cc
index 1497f98f059..a217576ef6b 100644
--- a/Build/source/texk/lcdf-typetools/libefont/otfpost.cc
+++ b/Build/source/texk/lcdf-typetools/libefont/otfpost.cc
@@ -140,10 +140,16 @@ Post::parse_header(ErrorHandler *errh)
const uint8_t *gni = data + HEADER_SIZE + 2;
const uint8_t *names = gni + 2 * _nglyphs;
int next_name = N_MAC_GLYPHS, g;
+ bool gni_error_reported = false;
for (int i = 0; i < _nglyphs; i++, gni += 2)
- if ((g = USHORT_AT(gni)) >= 32768)
- return errh->error("bad glyph name index in post"), -EINVAL;
- else
+ // Some fonts have more than 32768 glyphs. Although the 'post'
+ // spec says name indexes 32768-65535 are reserved, some large
+ // fonts treat those indexes as valid.
+ if ((g = USHORT_AT(gni)) >= 32768 && g >= _nglyphs) {
+ if (!gni_error_reported)
+ errh->error("bad glyph name index in post");
+ gni_error_reported = true;
+ } else
while (g >= next_name) {
if (names - data > len
|| (names + 1 + names[0]) - data > len)