diff options
| author | Jason Rumney | 2008-04-03 15:38:29 +0000 |
|---|---|---|
| committer | Jason Rumney | 2008-04-03 15:38:29 +0000 |
| commit | 6b8aa22a8ac19a46416737a6579cfcb77f647f18 (patch) | |
| tree | 0289c1fd47cc6f885507214462d0011bcba9b7e3 /src | |
| parent | cb7d9531e7dd987e57ba354b2d5af26022e51e5d (diff) | |
| download | emacs-6b8aa22a8ac19a46416737a6579cfcb77f647f18.tar.gz emacs-6b8aa22a8ac19a46416737a6579cfcb77f647f18.zip | |
(uniscribe_check_otf): Sanity check otf_spec.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/w32uniscribe.c | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 13bf77f34c0..f9cc1294a16 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2008-04-03 Jason Rumney <jasonr@gnu.org> | ||
| 2 | |||
| 3 | * w32uniscribe.c (uniscribe_check_otf): Sanity check otf_spec. | ||
| 4 | |||
| 1 | 2008-04-03 Kenichi Handa <handa@m17n.org> | 5 | 2008-04-03 Kenichi Handa <handa@m17n.org> |
| 2 | 6 | ||
| 3 | * coding.c (CATEGORY_MASK_ANY): Add CATEGORY_MASK_UTF_16_AUTO. | 7 | * coding.c (CATEGORY_MASK_ANY): Add CATEGORY_MASK_UTF_16_AUTO. |
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) | |||
| 564 | DWORD table; | 564 | DWORD table; |
| 565 | int i, retval = 0; | 565 | int i, retval = 0; |
| 566 | 566 | ||
| 567 | /* Check the spec is in the right format. */ | ||
| 568 | if (!CONSP (otf_spec) || Flength (val) < 3) | ||
| 569 | return 0; | ||
| 570 | |||
| 567 | /* Break otf_spec into its components. */ | 571 | /* Break otf_spec into its components. */ |
| 568 | script = XCAR (otf_spec); | 572 | script = XCAR (otf_spec); |
| 569 | rest = XCDR (otf_spec); | 573 | rest = XCDR (otf_spec); |
| @@ -609,6 +613,10 @@ int uniscribe_check_otf (font, otf_spec) | |||
| 609 | if (NILP (features[i])) | 613 | if (NILP (features[i])) |
| 610 | continue; | 614 | continue; |
| 611 | 615 | ||
| 616 | /* If features is not a cons, this font spec is messed up. */ | ||
| 617 | if (!CONSP (features[i])) | ||
| 618 | goto no_support; | ||
| 619 | |||
| 612 | /* Read GPOS/GSUB header. */ | 620 | /* Read GPOS/GSUB header. */ |
| 613 | OTF_INT16_VAL (tbl, 4, &scriptlist_table); | 621 | OTF_INT16_VAL (tbl, 4, &scriptlist_table); |
| 614 | OTF_INT16_VAL (tbl, 6, &feature_table); | 622 | OTF_INT16_VAL (tbl, 6, &feature_table); |