summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Sharp <ken.sharp@artifex.com>2020-09-14 14:32:23 +0100
committerChris Liddell <chris.liddell@artifex.com>2020-09-14 14:36:43 +0100
commit6d1440b2dabde655a2fe48ddbf0c09a82de4d423 (patch)
treebb932b6031be125bdba931154157b53254d6d486
parente54e9c5eaebc0bf06e57f754a3c16278de412459 (diff)
downloadghostpdl-6d1440b2dabde655a2fe48ddbf0c09a82de4d423.tar.gz
Fix crashes with pdfwrite, TrueType input fonts and Windows 64-bit build
With the change to 64-bits unconditionally for gs_glyph we can now define GS_MIN_CID_GLYPH in 64-bit terms. Previously we were using the architecture size of a long_long to determine which define to use, and we do not define long_long on Windows leading to us using an essentially 32-bit definition. This caused indexing off the end of an array in copied_glyph_slot()
-rw-r--r--base/gsccode.h5
1 files changed, 0 insertions, 5 deletions
diff --git a/base/gsccode.h b/base/gsccode.h
index 433818f0c..9ed3aa786 100644
--- a/base/gsccode.h
+++ b/base/gsccode.h
@@ -79,12 +79,7 @@ typedef uint64_t gs_glyph;
#define GS_NO_GLYPH ((gs_glyph)0x7fffffff)
-#if ARCH_SIZEOF_LONG_LONG > 4
# define GS_MIN_CID_GLYPH ((gs_glyph)0x80000000L)
-#else
-/* Avoid compiler warnings about signed/unsigned constants. */
-# define GS_MIN_CID_GLYPH ((gs_glyph)~0x7fffffff)
-#endif
#define GS_MIN_GLYPH_INDEX (GS_MIN_CID_GLYPH | (GS_MIN_CID_GLYPH >> 1))
#define GS_GLYPH_TAG (gs_glyph)(GS_MIN_CID_GLYPH | GS_MIN_GLYPH_INDEX)