texlive[59429] Build/source/texk/dvipdfm-x: dvipdfm-x/pdfencoding.c:

commits+hironobu at tug.org commits+hironobu at tug.org
Wed Jun 2 16:28:06 CEST 2021


Revision: 59429
          http://tug.org/svn/texlive?view=revision&revision=59429
Author:   hironobu
Date:     2021-06-02 16:28:06 +0200 (Wed, 02 Jun 2021)
Log Message:
-----------
dvipdfm-x/pdfencoding.c: fix a segmentation fault (M. Hosoda)

Modified Paths:
--------------
    trunk/Build/source/texk/dvipdfm-x/ChangeLog
    trunk/Build/source/texk/dvipdfm-x/pdfencoding.c

Modified: trunk/Build/source/texk/dvipdfm-x/ChangeLog
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/ChangeLog	2021-06-01 23:49:44 UTC (rev 59428)
+++ trunk/Build/source/texk/dvipdfm-x/ChangeLog	2021-06-02 14:28:06 UTC (rev 59429)
@@ -1,3 +1,9 @@
+2021-06-02  Masamichi HOSODA  <trueroad at trueroad.jp>
+
+	* pdfencoding.c: Fix a segmentation fault on pdfencoding.
+	https://tug.org/pipermail/dvipdfmx/2021-May/000270.html
+	https://github.com/texjporg/tex-jp-build/issues/114
+
 2021-05-31  Karl Berry  <karl at tug.org>
 
 	* dvipdfmx.1: bug reporting address now dvipdfmx at tug.org

Modified: trunk/Build/source/texk/dvipdfm-x/pdfencoding.c
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/pdfencoding.c	2021-06-01 23:49:44 UTC (rev 59428)
+++ trunk/Build/source/texk/dvipdfm-x/pdfencoding.c	2021-06-02 14:28:06 UTC (rev 59429)
@@ -74,7 +74,7 @@
   char     *glyphs[256];     /* ".notdef" must be represented as NULL */
   char      is_used[256];
 
-  struct pdf_encoding *baseenc;
+  int baseenc_id;
   pdf_obj  *tounicode;
 
   pdf_obj  *resource;
@@ -100,7 +100,7 @@
 
   encoding->tounicode = NULL;
 
-  encoding->baseenc   = NULL;
+  encoding->baseenc_id= -1;
   encoding->resource  = NULL;
 
   encoding->flags     = 0;
@@ -437,7 +437,7 @@
     if (baseenc_id < 0 || !pdf_encoding_is_predefined(baseenc_id))
       ERROR("Illegal base encoding %s for encoding %s\n",
 	    baseenc_name, encoding->enc_name);
-    encoding->baseenc = &enc_cache.encodings[baseenc_id];
+    encoding->baseenc_id = baseenc_id;
   }
 
   if (flags & FLAG_IS_PREDEFINED)
@@ -464,9 +464,11 @@
        */
       int with_base = !(encoding->flags & FLAG_USED_BY_TYPE3)
 	              || pdf_check_version(1, 4) >= 0;
+      pdf_encoding *baseenc = (encoding->baseenc_id < 0) ?
+	NULL : &enc_cache.encodings[encoding->baseenc_id];
       ASSERT(!encoding->resource);
       encoding->resource = create_encoding_resource(encoding,
-						    with_base ? encoding->baseenc : NULL);
+						    with_base ? baseenc : NULL);
       ASSERT(!encoding->tounicode);
       encoding->tounicode = pdf_create_ToUnicode_CMap(encoding->enc_name,
 						      encoding->glyphs,



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