Commit e38ac6e2 authored by Jason Rumney's avatar Jason Rumney
Browse files

(uniscribe_check_otf): Add GC protection before consing.

Use CAR_SAFE to increment loop.
parent e6fa807c
...@@ -563,6 +563,7 @@ int uniscribe_check_otf (font, otf_spec) ...@@ -563,6 +563,7 @@ int uniscribe_check_otf (font, otf_spec)
HFONT check_font, old_font; HFONT check_font, old_font;
DWORD table; DWORD table;
int i, retval = 0; int i, retval = 0;
struct gcpro gcpro1;
/* Check the spec is in the right format. */ /* Check the spec is in the right format. */
if (!CONSP (otf_spec) || Flength (otf_spec) < 3) if (!CONSP (otf_spec) || Flength (otf_spec) < 3)
...@@ -599,6 +600,10 @@ int uniscribe_check_otf (font, otf_spec) ...@@ -599,6 +600,10 @@ int uniscribe_check_otf (font, otf_spec)
check_font = CreateFontIndirect (font); check_font = CreateFontIndirect (font);
old_font = SelectObject (context, check_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. */ /* Scan GSUB and GPOS tables. */
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
{ {
...@@ -676,7 +681,7 @@ int uniscribe_check_otf (font, otf_spec) ...@@ -676,7 +681,7 @@ int uniscribe_check_otf (font, otf_spec)
documentation in font_prop_validate_otf, so count them. */ documentation in font_prop_validate_otf, so count them. */
n_match_features = 0; n_match_features = 0;
rest = features[i]; 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); rest = XCDR (rest);
if (!NILP (feature)) if (!NILP (feature))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment