aboutsummaryrefslogtreecommitdiffstats
path: root/src/macfont.m
diff options
context:
space:
mode:
Diffstat (limited to 'src/macfont.m')
-rw-r--r--src/macfont.m8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/macfont.m b/src/macfont.m
index 0e90eb44eeb..09c4ff31c88 100644
--- a/src/macfont.m
+++ b/src/macfont.m
@@ -1791,16 +1791,14 @@ macfont_get_open_type_spec (Lisp_Object otf_spec)
1791 spec->nfeatures[0] = spec->nfeatures[1] = 0; 1791 spec->nfeatures[0] = spec->nfeatures[1] = 0;
1792 for (i = 0; i < 2 && ! NILP (otf_spec); i++, otf_spec = XCDR (otf_spec)) 1792 for (i = 0; i < 2 && ! NILP (otf_spec); i++, otf_spec = XCDR (otf_spec))
1793 { 1793 {
1794 Lisp_Object len;
1795
1796 val = XCAR (otf_spec); 1794 val = XCAR (otf_spec);
1797 if (NILP (val)) 1795 if (NILP (val))
1798 continue; 1796 continue;
1799 len = Flength (val); 1797 ptrdiff_t len = list_length (val);
1800 spec->features[i] = 1798 spec->features[i] =
1801 (min (PTRDIFF_MAX, SIZE_MAX) / sizeof (int) < XFIXNUM (len) 1799 (min (PTRDIFF_MAX, SIZE_MAX) / sizeof (int) < len
1802 ? 0 1800 ? 0
1803 : malloc (XFIXNUM (len) * sizeof *spec->features[i])); 1801 : malloc (len * sizeof *spec->features[i]));
1804 if (! spec->features[i]) 1802 if (! spec->features[i])
1805 { 1803 {
1806 if (i > 0 && spec->features[0]) 1804 if (i > 0 && spec->features[0])