summaryrefslogtreecommitdiff
path: root/xps
diff options
context:
space:
mode:
authorKen Sharp <ken.sharp@artifex.com>2022-07-24 12:58:11 +0100
committerKen Sharp <ken.sharp@artifex.com>2022-07-24 12:58:11 +0100
commit162038b3e2ad0000d701e0619e11b46ec63b6f4c (patch)
treef0e40910fe61794beb1aa879f05d4a83a1cd8471 /xps
parentc6df4d53b43ce9cffdaeb4141f82d583dd174937 (diff)
downloadghostpdl-162038b3e2ad0000d701e0619e11b46ec63b6f4c.tar.gz
GhostXPS - fix commit 7642e51271eafd012a80722b5f82226188de90a2
It seems that the logic was inverted here, we should check that the size of the font is enough to satisfy the absolute minimum for the number of fonts in the collection. The previous commit was throwing an error if the length of the font was more than the minimum. Basically all TrueType collections were detected as being in error. This was causing incorrect output, non-deterministic output and, on 32-bit tests, seg faults. The latter problems I find surprising.....
Diffstat (limited to 'xps')
-rw-r--r--xps/xpsfont.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xps/xpsfont.c b/xps/xpsfont.c
index 410c85c6e..7ec5416fe 100644
--- a/xps/xpsfont.c
+++ b/xps/xpsfont.c
@@ -135,7 +135,7 @@ xps_find_sfnt_table(xps_font_t *font, const char *name, int *lengthp)
/* check if the buffer contains enough data to contain nfonts subfonts */
int min_len = 12 + nfonts * 4;
- if (min_len < font->length)
+ if (font->length < min_len)
{
gs_warn("font data length too small");
return -1;