texlive[69520] Build/source/texk/ttfdump: allocate number of hdmx

commits+karl at tug.org commits+karl at tug.org
Sun Jan 21 19:28:52 CET 2024


Revision: 69520
          https://tug.org/svn/texlive?view=revision&revision=69520
Author:   karl
Date:     2024-01-21 19:28:51 +0100 (Sun, 21 Jan 2024)
Log Message:
-----------
allocate number of hdmx widths read, per 	https://github.com/TeX-Live/texlive-source/pull/63

Modified Paths:
--------------
    trunk/Build/source/texk/ttfdump/ChangeLog
    trunk/Build/source/texk/ttfdump/libttf/hdmx.c

Modified: trunk/Build/source/texk/ttfdump/ChangeLog
===================================================================
--- trunk/Build/source/texk/ttfdump/ChangeLog	2024-01-21 17:40:41 UTC (rev 69519)
+++ trunk/Build/source/texk/ttfdump/ChangeLog	2024-01-21 18:28:51 UTC (rev 69520)
@@ -1,3 +1,13 @@
+2024-01-21  Karl Berry  <karl at 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 at t-lab.opal.ne.jp>
 
 	* tests/ttfdump.test: Make easier to test on Windows.

Modified: trunk/Build/source/texk/ttfdump/libttf/hdmx.c
===================================================================
--- trunk/Build/source/texk/ttfdump/libttf/hdmx.c	2024-01-21 17:40:41 UTC (rev 69519)
+++ trunk/Build/source/texk/ttfdump/libttf/hdmx.c	2024-01-21 18:28:51 UTC (rev 69520)
@@ -43,7 +43,7 @@
 	{
 	    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);
 	}
 }



More information about the tex-live-commits mailing list.