aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2024-08-20 21:57:25 +0800
committerPo Lu2024-08-20 21:57:25 +0800
commita2684967270387d2e7ec79de148f04b7f54f2260 (patch)
tree41098b24a2e99cd9f05448d18ea4f1c9fa808606 /src
parente1ee82f7387fa4e8c2d2bc096eae393298906329 (diff)
parent3419e7ea522462c47a5ab4389a879d8b7c14452b (diff)
downloademacs-a2684967270387d2e7ec79de148f04b7f54f2260.tar.gz
emacs-a2684967270387d2e7ec79de148f04b7f54f2260.zip
Merge from savannah/emacs-30
3419e7ea522 Correct Android failure to open an old CJK font 45ae4de0e7c * lisp/help-fns.el (help-definition-prefixes): Don't dele... fc7581ae2ee ; Fix documentation of secure-hash functions 21be5cadaf1 ; * lisp/subr.el (sha1): Fix typo in docstring. 8715619d485 ; * etc/NEWS: Fix wording of last change. 023d387a7bd Update to Org 9.7.10 b54e8b3741b ; * etc/NEWS: Announce 'shr-fill-text'. acfd91bc0c7 ; * lisp/emacs-lisp/compat.el: Fix header style. 55337dc36a2 * test/infra/gitlab-ci.yml (.tree-sitter-template): Adapt... d8e9eb73c2b Bump use-package version for Emacs 30.1 4d9d3fec1b9 * Makefile.in (CHANGELOG_HISTORY_INDEX_MAX): Bump. 502285e84aa ; * admin/make-tarball.txt: Some clarifications.
Diffstat (limited to 'src')
-rw-r--r--src/fns.c4
-rw-r--r--src/sfnt.c19
2 files changed, 15 insertions, 8 deletions
diff --git a/src/fns.c b/src/fns.c
index c788ea54ec7..80794bc73a0 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -6422,7 +6422,9 @@ whole OBJECT.
6422 6422
6423The full list of algorithms can be obtained with `secure-hash-algorithms'. 6423The full list of algorithms can be obtained with `secure-hash-algorithms'.
6424 6424
6425If BINARY is non-nil, returns a string in binary form. 6425If BINARY is non-nil, returns a string in binary form. In this case,
6426the function returns a unibyte string whose length is half the number
6427of characters it returns when BINARY is nil.
6426 6428
6427Note that MD5 and SHA-1 are not collision resistant and should not be 6429Note that MD5 and SHA-1 are not collision resistant and should not be
6428used for anything security-related. For these applications, use one 6430used for anything security-related. For these applications, use one
diff --git a/src/sfnt.c b/src/sfnt.c
index 1ed492b7506..02b8a33041c 100644
--- a/src/sfnt.c
+++ b/src/sfnt.c
@@ -383,15 +383,18 @@ sfnt_read_cmap_format_2 (int fd,
383 383
384 for (i = 0; i < 256; ++i) 384 for (i = 0; i < 256; ++i)
385 { 385 {
386 /* Values in sub_header_keys are actually offsets from the end of
387 that array. Since the language of the spec is such as to imply
388 that they must be divisible by eight, divide them by the
389 same. */
386 sfnt_swap16 (&format2->sub_header_keys[i]); 390 sfnt_swap16 (&format2->sub_header_keys[i]);
387 391
388 if (format2->sub_header_keys[i] > nsub) 392 if (format2->sub_header_keys[i] > nsub)
389 nsub = format2->sub_header_keys[i]; 393 nsub = format2->sub_header_keys[i] / 8;
390 } 394 }
391 395
392 if (!nsub) 396 /* There always exists a subheader at index zero. */
393 /* If there are no subheaders, then things are finished. */ 397 nsub ++;
394 return format2;
395 398
396 /* Otherwise, read the rest of the variable length data to the end 399 /* Otherwise, read the rest of the variable length data to the end
397 of format2. */ 400 of format2. */
@@ -1108,9 +1111,11 @@ sfnt_lookup_glyph_2 (sfnt_char character,
1108 && j <= ((int) subheader->first_code 1111 && j <= ((int) subheader->first_code
1109 + (int) subheader->entry_count)) 1112 + (int) subheader->entry_count))
1110 { 1113 {
1111 /* id_range_offset is actually the number of bytes past 1114 /* id_range_offset is actually the number of bytes past itself
1112 itself containing the uint16_t ``slice''. It is possibly 1115 containing the uint16_t ``slice''. Whether this may be
1113 unaligned. */ 1116 unaligned is not stated in the specification, but I doubt
1117 it, for that would render values meaningless if the array
1118 were byte swapped when read. */
1114 slice = (unsigned char *) &subheader->id_range_offset; 1119 slice = (unsigned char *) &subheader->id_range_offset;
1115 slice += subheader->id_range_offset; 1120 slice += subheader->id_range_offset;
1116 slice += (j - subheader->first_code) * sizeof (uint16_t); 1121 slice += (j - subheader->first_code) * sizeof (uint16_t);