diff options
| author | Jason Rumney | 2008-04-04 11:59:09 +0000 |
|---|---|---|
| committer | Jason Rumney | 2008-04-04 11:59:09 +0000 |
| commit | e38ac6e20364469afe2700548120924ad5807e56 (patch) | |
| tree | 25e66ab9c26aff3c925dcaa2fc167da6cd0e5160 /src | |
| parent | e6fa807c5ae9f8c5aecc7b99b03fbe54c4085dd5 (diff) | |
| download | emacs-e38ac6e20364469afe2700548120924ad5807e56.tar.gz emacs-e38ac6e20364469afe2700548120924ad5807e56.zip | |
(uniscribe_check_otf): Add GC protection before consing.
Use CAR_SAFE to increment loop.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32uniscribe.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c index 2641aead054..62734d05cde 100644 --- a/src/w32uniscribe.c +++ b/src/w32uniscribe.c | |||
| @@ -563,6 +563,7 @@ int uniscribe_check_otf (font, otf_spec) | |||
| 563 | HFONT check_font, old_font; | 563 | HFONT check_font, old_font; |
| 564 | DWORD table; | 564 | DWORD table; |
| 565 | int i, retval = 0; | 565 | int i, retval = 0; |
| 566 | struct gcpro gcpro1; | ||
| 566 | 567 | ||
| 567 | /* Check the spec is in the right format. */ | 568 | /* Check the spec is in the right format. */ |
| 568 | if (!CONSP (otf_spec) || Flength (otf_spec) < 3) | 569 | if (!CONSP (otf_spec) || Flength (otf_spec) < 3) |
| @@ -599,6 +600,10 @@ int uniscribe_check_otf (font, otf_spec) | |||
| 599 | check_font = CreateFontIndirect (font); | 600 | check_font = CreateFontIndirect (font); |
| 600 | old_font = SelectObject (context, check_font); | 601 | old_font = SelectObject (context, check_font); |
| 601 | 602 | ||
| 603 | /* Everything else is contained within otf_spec so should get | ||
| 604 | marked along with it. */ | ||
| 605 | GCPRO1 (otf_spec); | ||
| 606 | |||
| 602 | /* Scan GSUB and GPOS tables. */ | 607 | /* Scan GSUB and GPOS tables. */ |
| 603 | for (i = 0; i < 2; i++) | 608 | for (i = 0; i < 2; i++) |
| 604 | { | 609 | { |
| @@ -676,7 +681,7 @@ int uniscribe_check_otf (font, otf_spec) | |||
| 676 | documentation in font_prop_validate_otf, so count them. */ | 681 | documentation in font_prop_validate_otf, so count them. */ |
| 677 | n_match_features = 0; | 682 | n_match_features = 0; |
| 678 | rest = features[i]; | 683 | rest = features[i]; |
| 679 | for (feature = XCAR (rest); CONSP (rest); feature = XCAR (rest)) | 684 | for (feature = XCAR (rest); CONSP (rest); feature = CAR_SAFE (rest)) |
| 680 | { | 685 | { |
| 681 | rest = XCDR (rest); | 686 | rest = XCDR (rest); |
| 682 | if (!NILP (feature)) | 687 | if (!NILP (feature)) |