diff options
author | Karl Berry <karl@freefriends.org> | 2024-01-21 18:28:51 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-01-21 18:28:51 +0000 |
commit | 3ef966c807fe0c325ce5f26c5b2c1a086ee87e61 (patch) | |
tree | 32684b099b2b5909bba6d2bda1ae3888b456a911 /Build/source/texk/ttfdump | |
parent | 3b78c02b7cc4ac540d209b3d3d2b3da18a9d6b7d (diff) |
allocate number of hdmx widths read, per https://github.com/TeX-Live/texlive-source/pull/63
git-svn-id: svn://tug.org/texlive/trunk@69520 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/ttfdump')
-rw-r--r-- | Build/source/texk/ttfdump/ChangeLog | 10 | ||||
-rw-r--r-- | Build/source/texk/ttfdump/libttf/hdmx.c | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/Build/source/texk/ttfdump/ChangeLog b/Build/source/texk/ttfdump/ChangeLog index 027949dcf93..994affe1fb7 100644 --- a/Build/source/texk/ttfdump/ChangeLog +++ b/Build/source/texk/ttfdump/ChangeLog @@ -1,3 +1,13 @@ +2024-01-21 Karl Berry <karl@freefriends.org> + + * libttf/hdmx.c (ttfLoadHDMX): calloc the number of widths that we + actually read, namely numGlyphs+1. I don't understand why this + is numGlyphs+1 and not numGlyphs, per +https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6hdmx.html + but since the program has always read numGlyphs+1, just leaving it. + Report (and alternate fix) from attackoncs, + https://github.com/TeX-Live/texlive-source/pull/63 + 2023-08-13 TANAKA Takuji <ttk@t-lab.opal.ne.jp> * tests/ttfdump.test: Make easier to test on Windows. diff --git a/Build/source/texk/ttfdump/libttf/hdmx.c b/Build/source/texk/ttfdump/libttf/hdmx.c index d91b98eb1b3..0332cbcb434 100644 --- a/Build/source/texk/ttfdump/libttf/hdmx.c +++ b/Build/source/texk/ttfdump/libttf/hdmx.c @@ -43,7 +43,7 @@ static void ttfLoadHDMX (FILE *fp,HDMXPtr hdmx,ULONG offset) { hdmx->Records[i].PixelSize = ttfGetBYTE(fp); hdmx->Records[i].MaxWidth = ttfGetBYTE(fp); - hdmx->Records[i].Width = XCALLOC (hdmx->size, BYTE); + hdmx->Records[i].Width = XCALLOC (hdmx->numGlyphs+1, BYTE); fread ((hdmx->Records+i)->Width, sizeof(BYTE), hdmx->numGlyphs+1,fp); } } |