summaryrefslogtreecommitdiff
path: root/src/w32uniscribe.c
diff options
context:
space:
mode:
authorJason Rumney <jasonr@gnu.org>2008-04-03 15:38:29 +0000
committerJason Rumney <jasonr@gnu.org>2008-04-03 15:38:29 +0000
commit6b8aa22a8ac19a46416737a6579cfcb77f647f18 (patch)
tree0289c1fd47cc6f885507214462d0011bcba9b7e3 /src/w32uniscribe.c
parentcb7d9531e7dd987e57ba354b2d5af26022e51e5d (diff)
downloademacs-6b8aa22a8ac19a46416737a6579cfcb77f647f18.tar.gz
(uniscribe_check_otf): Sanity check otf_spec.
Diffstat (limited to 'src/w32uniscribe.c')
-rw-r--r--src/w32uniscribe.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c
index fd10b9fc0f7..ed29955efe9 100644
--- a/src/w32uniscribe.c
+++ b/src/w32uniscribe.c
@@ -564,6 +564,10 @@ int uniscribe_check_otf (font, otf_spec)
DWORD table;
int i, retval = 0;
+ /* Check the spec is in the right format. */
+ if (!CONSP (otf_spec) || Flength (val) < 3)
+ return 0;
+
/* Break otf_spec into its components. */
script = XCAR (otf_spec);
rest = XCDR (otf_spec);
@@ -609,6 +613,10 @@ int uniscribe_check_otf (font, otf_spec)
if (NILP (features[i]))
continue;
+ /* If features is not a cons, this font spec is messed up. */
+ if (!CONSP (features[i]))
+ goto no_support;
+
/* Read GPOS/GSUB header. */
OTF_INT16_VAL (tbl, 4, &scriptlist_table);
OTF_INT16_VAL (tbl, 6, &feature_table);