[tex4ht-commits] [SCM] tex4ht updated: r1387 - trunk/lit

Karl Berry INVALID.NOREPLY at gnu.org.ua
Thu Oct 12 18:10:29 CEST 2023


Author: karl
Date: 2023-10-12 16:10:29 +0000 (Thu, 12 Oct 2023)
New Revision: 1387

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-c.tex
Log:
avoid negative index into font_tbl

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2023-10-12 14:03:28 UTC (rev 1386)
+++ trunk/lit/ChangeLog	2023-10-12 16:10:29 UTC (rev 1387)
@@ -1,3 +1,9 @@
+2023-10-12  Karl Berry  <karl at freefriends.org>
+
+	* tex4ht-c.tex (<span char block>): avoid negative indexing into
+	font_tbl. Partial fix for report from Oliver Freyermuth,
+	https://puszcza.gnu.org.ua/bugs/?611.
+
 2023-10-12  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-4ht.tex (piton.4ht): use e-type Expl3 functions.

Modified: trunk/lit/tex4ht-c.tex
===================================================================
--- trunk/lit/tex4ht-c.tex	2023-10-12 14:03:28 UTC (rev 1386)
+++ trunk/lit/tex4ht-c.tex	2023-10-12 16:10:29 UTC (rev 1387)
@@ -1,6 +1,6 @@
 % $Id$
 % tex tex4ht-c
-% Copyright 2009-2018 TeX Users Group
+% Copyright 2009-2023 TeX Users Group
 % Copyright 1996-2009 Eitan M. Gurari
 % Released under LPPL 1.3c+.
 % See tex4ht-cpright.tex for license text.
@@ -230,7 +230,7 @@
 
 \<tex4ht.c\><<< 
 /* tex4ht.c (`version), generated from `jobname.tex
-   Copyright 2009-2018 TeX Users Group
+   Copyright 2009-2023 TeX Users Group
    Copyright `CopyYear.1996. Eitan M. Gurari
 `<TeX4ht copyright`> */
 `<tex4ht.h`>
@@ -2582,11 +2582,15 @@
 static BOOL start_span = FALSE, in_span_ch = FALSE;
 >>>
 
+A span special might happen before any font has been defined (fntdef DVI
+command seen). In that case, |cur_fnt| will still be $-1$, and we must
+avoid indexing |font_tbl|. 
 
+See report at https://puszcza.gnu.org.ua/bugs/?611.
 
 \<span char block\><<<
 if( span_on && !in_span_ch  && !ignore_chs && !in_accenting
-            && (default_font != font_tbl[cur_fnt].num) ){
+            && cur_fnt >= 0 && (default_font != font_tbl[cur_fnt].num) ){
   if(  (ch < 137) && (ch != `<insert rule + move op`>) ){
     in_span_ch = TRUE; start_span = TRUE;    
 } }



More information about the tex4ht-commits mailing list.