From e38ac6e20364469afe2700548120924ad5807e56 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Fri, 4 Apr 2008 11:59:09 +0000 Subject: (uniscribe_check_otf): Add GC protection before consing. Use CAR_SAFE to increment loop. --- src/w32uniscribe.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/w32uniscribe.c') diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c index 2641aead05..62734d05cd 100644 --- a/src/w32uniscribe.c +++ b/src/w32uniscribe.c @@ -563,6 +563,7 @@ int uniscribe_check_otf (font, otf_spec) HFONT check_font, old_font; DWORD table; int i, retval = 0; + struct gcpro gcpro1; /* Check the spec is in the right format. */ if (!CONSP (otf_spec) || Flength (otf_spec) < 3) @@ -599,6 +600,10 @@ int uniscribe_check_otf (font, otf_spec) check_font = CreateFontIndirect (font); old_font = SelectObject (context, check_font); + /* Everything else is contained within otf_spec so should get + marked along with it. */ + GCPRO1 (otf_spec); + /* Scan GSUB and GPOS tables. */ for (i = 0; i < 2; i++) { @@ -676,7 +681,7 @@ int uniscribe_check_otf (font, otf_spec) documentation in font_prop_validate_otf, so count them. */ n_match_features = 0; rest = features[i]; - for (feature = XCAR (rest); CONSP (rest); feature = XCAR (rest)) + for (feature = XCAR (rest); CONSP (rest); feature = CAR_SAFE (rest)) { rest = XCDR (rest); if (!NILP (feature)) -- cgit v1.2.3