texlive[48853] Build/source/texk/dvipdfm-x: Fix a bug in inline PS

commits+kakuto at tug.org commits+kakuto at tug.org
Sun Oct 7 23:27:40 CEST 2018


Revision: 48853
          http://tug.org/svn/texlive?view=revision&revision=48853
Author:   kakuto
Date:     2018-10-07 23:27:40 +0200 (Sun, 07 Oct 2018)
Log Message:
-----------
Fix a bug in inline PS code handling (S. Hirata)

Modified Paths:
--------------
    trunk/Build/source/texk/dvipdfm-x/ChangeLog
    trunk/Build/source/texk/dvipdfm-x/configure
    trunk/Build/source/texk/dvipdfm-x/configure.ac
    trunk/Build/source/texk/dvipdfm-x/dpxfile.c
    trunk/Build/source/texk/dvipdfm-x/mpost.c
    trunk/Build/source/texk/dvipdfm-x/pdfencrypt.c
    trunk/Build/source/texk/dvipdfm-x/pdfobj.c
    trunk/Build/source/texk/dvipdfm-x/type0.c

Modified: trunk/Build/source/texk/dvipdfm-x/ChangeLog
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/ChangeLog	2018-10-07 21:08:27 UTC (rev 48852)
+++ trunk/Build/source/texk/dvipdfm-x/ChangeLog	2018-10-07 21:27:40 UTC (rev 48853)
@@ -1,3 +1,10 @@
+2018-10-08  Shunsaku Hirata  <shunsaku.hirata74 at gmail.com>
+
+	* mpost.c: Fix a bug in inline PS code handling.
+	* dpxfile.c, pdfencrypt.c, type0.c: Avoid compiler warnings.
+	* pdfobj.c: Fix a bug in (unused) TIFF predictor code.
+	* configure.ac: Version 20181008.
+
 2018-10-07  Simon Cozens  <simon at simon-cozens.org>
 
 	* pdfobj.c: Clear static variables to allow PDF funcfions to

Modified: trunk/Build/source/texk/dvipdfm-x/configure
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/configure	2018-10-07 21:08:27 UTC (rev 48852)
+++ trunk/Build/source/texk/dvipdfm-x/configure	2018-10-07 21:27:40 UTC (rev 48853)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for dvipdfm-x (TeX Live) 20181002.
+# Generated by GNU Autoconf 2.69 for dvipdfm-x (TeX Live) 20181008.
 #
 # Report bugs to <tex-k at tug.org>.
 #
@@ -590,8 +590,8 @@
 # Identity of this package.
 PACKAGE_NAME='dvipdfm-x (TeX Live)'
 PACKAGE_TARNAME='dvipdfm-x--tex-live-'
-PACKAGE_VERSION='20181002'
-PACKAGE_STRING='dvipdfm-x (TeX Live) 20181002'
+PACKAGE_VERSION='20181008'
+PACKAGE_STRING='dvipdfm-x (TeX Live) 20181008'
 PACKAGE_BUGREPORT='tex-k at tug.org'
 PACKAGE_URL=''
 
@@ -1350,7 +1350,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures dvipdfm-x (TeX Live) 20181002 to adapt to many kinds of systems.
+\`configure' configures dvipdfm-x (TeX Live) 20181008 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1421,7 +1421,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of dvipdfm-x (TeX Live) 20181002:";;
+     short | recursive ) echo "Configuration of dvipdfm-x (TeX Live) 20181008:";;
    esac
   cat <<\_ACEOF
 
@@ -1551,7 +1551,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-dvipdfm-x (TeX Live) configure 20181002
+dvipdfm-x (TeX Live) configure 20181008
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2390,7 +2390,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by dvipdfm-x (TeX Live) $as_me 20181002, which was
+It was created by dvipdfm-x (TeX Live) $as_me 20181008, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -8075,7 +8075,7 @@
 
 # Define the identity of the package.
  PACKAGE='dvipdfm-x--tex-live-'
- VERSION='20181002'
+ VERSION='20181008'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -14744,7 +14744,7 @@
 Report bugs to <bug-libtool at gnu.org>."
 
 lt_cl_version="\
-dvipdfm-x (TeX Live) config.lt 20181002
+dvipdfm-x (TeX Live) config.lt 20181008
 configured by $0, generated by GNU Autoconf 2.69.
 
 Copyright (C) 2011 Free Software Foundation, Inc.
@@ -16624,7 +16624,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by dvipdfm-x (TeX Live) $as_me 20181002, which was
+This file was extended by dvipdfm-x (TeX Live) $as_me 20181008, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -16694,7 +16694,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-dvipdfm-x (TeX Live) config.status 20181002
+dvipdfm-x (TeX Live) config.status 20181008
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Modified: trunk/Build/source/texk/dvipdfm-x/configure.ac
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/configure.ac	2018-10-07 21:08:27 UTC (rev 48852)
+++ trunk/Build/source/texk/dvipdfm-x/configure.ac	2018-10-07 21:27:40 UTC (rev 48853)
@@ -7,7 +7,7 @@
 dnl   gives unlimited permission to copy and/or distribute it,
 dnl   with or without modifications, as long as this notice is preserved.
 dnl
-AC_INIT([dvipdfm-x (TeX Live)], [20181002], [tex-k at tug.org])
+AC_INIT([dvipdfm-x (TeX Live)], [20181008], [tex-k at tug.org])
 AC_PREREQ([2.65])
 AC_CONFIG_SRCDIR([agl.c])
 AC_CONFIG_AUX_DIR([../../build-aux])

Modified: trunk/Build/source/texk/dvipdfm-x/dpxfile.c
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/dpxfile.c	2018-10-07 21:08:27 UTC (rev 48852)
+++ trunk/Build/source/texk/dvipdfm-x/dpxfile.c	2018-10-07 21:27:40 UTC (rev 48853)
@@ -1050,7 +1050,7 @@
         }
         break;
       case  'v': /* Version number, e.g. 1.4 */ {
-       char buf[6];
+       char buf[256];
        sprintf(buf, "%d.%d", version/10, version%10);
        need(cmd, n, size, strlen(buf));
        strcpy(cmd + n, buf);  n += strlen(buf);

Modified: trunk/Build/source/texk/dvipdfm-x/mpost.c
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/mpost.c	2018-10-07 21:08:27 UTC (rev 48852)
+++ trunk/Build/source/texk/dvipdfm-x/mpost.c	2018-10-07 21:27:40 UTC (rev 48853)
@@ -199,7 +199,7 @@
 static void
 clear_fonts (void)
 {
-  while (currentfont >= 0) {
+  while (currentfont > 0) {
     clear_mp_font_struct(&font_stack[currentfont]);
     currentfont--;
   }

Modified: trunk/Build/source/texk/dvipdfm-x/pdfencrypt.c
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/pdfencrypt.c	2018-10-07 21:08:27 UTC (rev 48852)
+++ trunk/Build/source/texk/dvipdfm-x/pdfencrypt.c	2018-10-07 21:27:40 UTC (rev 48853)
@@ -98,13 +98,13 @@
   MD5_init(&md5);
   /* Don't use timezone for compatibility */
   dpx_util_format_asn_date(datestr, 0);
-  MD5_write(&md5, (unsigned char *)datestr, strlen(datestr));
+  MD5_write(&md5, (const unsigned char *)datestr, strlen(datestr));
   if (producer)
-    MD5_write(&md5, (unsigned char *)producer, strlen(producer));
+    MD5_write(&md5, (const unsigned char *)producer, strlen(producer));
   if (dviname)
-    MD5_write(&md5, (unsigned char *)dviname, strlen(dviname));
+    MD5_write(&md5, (const unsigned char *)dviname, strlen(dviname));
   if (pdfname)
-    MD5_write(&md5, (unsigned char *)pdfname, strlen(pdfname));
+    MD5_write(&md5, (const unsigned char *)pdfname, strlen(pdfname));
   MD5_final(p->ID, &md5);
 }
 
@@ -284,18 +284,21 @@
                  const unsigned char *salt,
                  const unsigned char *user_key, int R /* revision */)
 {
-  SHA256_CONTEXT sha;
   unsigned char  K[64];
   size_t         K_len;
   int            nround;
 
-  SHA256_init (&sha);
-  SHA256_write(&sha, (const unsigned char *)passwd, strlen(passwd));
-  SHA256_write(&sha, salt, 8);
-  if (user_key)
-    SHA256_write(&sha, user_key, 48);
-  SHA256_final(hash, &sha);
+  {
+    SHA256_CONTEXT sha;
 
+    SHA256_init (&sha);
+    SHA256_write(&sha, (const unsigned char *)passwd, strlen(passwd));
+    SHA256_write(&sha, salt, 8);
+    if (user_key)
+      SHA256_write(&sha, user_key, 48);
+    SHA256_final(hash, &sha);
+  }
+
   ASSERT( R ==5 || R == 6 );
 
   if (R == 5)

Modified: trunk/Build/source/texk/dvipdfm-x/pdfobj.c
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/pdfobj.c	2018-10-07 21:08:27 UTC (rev 48852)
+++ trunk/Build/source/texk/dvipdfm-x/pdfobj.c	2018-10-07 21:27:40 UTC (rev 48853)
@@ -1823,20 +1823,6 @@
   return  dst;
 }
 
-/* TIFF predictor filter support
- *
- * Many PDF viewers seems to have broken TIFF 2 predictor support?
- * Ony GhostScript and MuPDF render 4bpc grayscale image with TIFF 2 predictor
- * filter applied correctly.
- *
- *  Acrobat Reader DC  2015.007.20033  NG
- *  Adobe Acrobat X    10.1.13         NG
- *  Foxit Reader       4.1.5.425       NG
- *  GhostScript        9.16            OK
- *  SumatraPDF(MuPDF)  v3.0            OK
- *  Evince(poppler)    2.32.0.145      NG (1bit and 4bit broken)
- */
-
 /* This modifies "raster" itself! */
 static void
 apply_filter_TIFF2_1_2_4 (unsigned char *raster,
@@ -1890,13 +1876,14 @@
         }
       }
     }
-    if (outbits > 0)
+    if (outbits > 0) {
       raster[k] = (outbuf << (8 - outbits)); k++;
+    }
   }
   RELEASE(prev);
 }
 
-unsigned char *
+static unsigned char *
 filter_TIFF2_apply_filter (unsigned char *raster,
                            int32_t columns, int32_t rows,
                            int8_t bpc, int8_t colors, int32_t *length)

Modified: trunk/Build/source/texk/dvipdfm-x/type0.c
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/type0.c	2018-10-07 21:08:27 UTC (rev 48852)
+++ trunk/Build/source/texk/dvipdfm-x/type0.c	2018-10-07 21:27:40 UTC (rev 48853)
@@ -221,7 +221,6 @@
     case CIDFONT_TYPE2:
     /* PLEASE FIX THIS */
       {
-        CIDFont *cidfont = font->descendant;
         tounicode = otf_create_ToUnicode_stream(CIDFont_get_ident(cidfont),
                                                 CIDFont_get_opt_index(cidfont),
                                                 CIDFont_get_fontname(cidfont),
@@ -230,7 +229,6 @@
       break;
     default:
       if (CIDFont_get_flag(cidfont, CIDFONT_FLAG_TYPE1C)) {
-        CIDFont *cidfont = font->descendant;
         tounicode = otf_create_ToUnicode_stream(CIDFont_get_ident(cidfont),
                                                 CIDFont_get_opt_index(cidfont),
                                                 CIDFont_get_fontname(cidfont),



More information about the tex-live-commits mailing list