Skip to content

Commit

Permalink
allocate number of hdmx widths read, per #63
Browse files Browse the repository at this point in the history
git-svn-id: svn://tug.org/texlive/trunk/Build/source@69520 c570f23f-e606-0410-a88d-b1316a301751
  • Loading branch information
kberry committed Jan 21, 2024
1 parent 65b84da commit a9d26d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions 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.
Expand Down
2 changes: 1 addition & 1 deletion texk/ttfdump/libttf/hdmx.c
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit a9d26d4

Please sign in to comment.