diff options
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/tounicode.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Build/source/texk/web2c/pdftexdir/tounicode.c b/Build/source/texk/web2c/pdftexdir/tounicode.c index 16ab10bdae2..716ebf6ea66 100644 --- a/Build/source/texk/web2c/pdftexdir/tounicode.c +++ b/Build/source/texk/web2c/pdftexdir/tounicode.c @@ -1,5 +1,5 @@ /* -Copyright 2006-2014 Han The Thanh, <thanh@pdftex.org> +Copyright 2006-2017 Han The Thanh, <thanh@pdftex.org> This file is part of pdfTeX. @@ -75,7 +75,7 @@ void deftounicode(strnumber glyph, strnumber unistr) p++; /* ignore leading spaces */ l = strlen(p); while (l > 0 && p[l - 1] == ' ') - l--; /* ignore traling spaces */ + l--; /* ignore trailing spaces */ valid_unistr = 1; /* a unicode value is the most common case */ for (i = 0; i < l; i++) { if (p[i] == ' ') @@ -117,6 +117,11 @@ void deftounicode(strnumber glyph, strnumber unistr) } else { i = sscanf(p, "%lX", &(gu->code)); assert(i == 1); + if (gu->code < 0 || gu->code > 0x10FFFF) { + pdftex_warn("ToUnicode: value out of range [0,10FFFF]: %X", + gu->code); + gu->code = UNI_UNDEF; + } } aa = avl_probe(glyph_unicode_tree, gu); assert(aa != NULL); |