summaryrefslogtreecommitdiff
path: root/base/gxfapi.h
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2018-01-19 14:28:46 +0000
committerChris Liddell <chris.liddell@artifex.com>2018-01-26 15:02:05 +0000
commit2b155ebd780b5737aac4e8096c8fbaa5cb78212c (patch)
treef0b87da4a74c4e6ff1a830c46291f43140403b78 /base/gxfapi.h
parentb82848bc26f47b5b5727d24f03d08eb3679c7243 (diff)
downloadghostpdl-2b155ebd780b5737aac4e8096c8fbaa5cb78212c.tar.gz
Bug 694260: FAPI: tidy up error return for broken TT glyph
In the event of an error retrieving a TTF glyph, we were storing the negative error code in the same variable we use to store the glyph length for a valid glyph, which is an unsigned variable, causing a valgrind error, and potential security issue reading uninitialized memory. In fact, other consumers silently cope with this type of problem and (presumably) use a notdef glyph instead. So this tweaks the error codes to do the same. Because we now have to differentiate between different types of error, we can no longer just use a negative value, so there is an enumerated type for the error values.
Diffstat (limited to 'base/gxfapi.h')
-rw-r--r--base/gxfapi.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/base/gxfapi.h b/base/gxfapi.h
index 87a9ef40f..3cd71bca5 100644
--- a/base/gxfapi.h
+++ b/base/gxfapi.h
@@ -104,6 +104,12 @@ typedef enum
typedef enum
{
+ gs_fapi_glyph_invalid_format = -1,
+ gs_fapi_glyph_invalid_index = -2
+} gs_fapi_glyph_error;
+
+typedef enum
+{
gs_fapi_metrics_notdef,
gs_fapi_metrics_add, /* Add to native glyph width. */
gs_fapi_metrics_replace_width, /* Replace the native glyph width. */