texlive[55685] Build/source/texk/dvipdfm-x: Add missing memory

commits+kakuto at tug.org commits+kakuto at tug.org
Sun Jun 28 11:01:20 CEST 2020


Revision: 55685
          http://tug.org/svn/texlive?view=revision&revision=55685
Author:   kakuto
Date:     2020-06-28 11:01:20 +0200 (Sun, 28 Jun 2020)
Log Message:
-----------
Add missing memory release, missing variable initialization, etc. (S. Hirata).

Modified Paths:
--------------
    trunk/Build/source/texk/dvipdfm-x/ChangeLog
    trunk/Build/source/texk/dvipdfm-x/pdfcolor.c
    trunk/Build/source/texk/dvipdfm-x/pdfdoc.c
    trunk/Build/source/texk/dvipdfm-x/spc_dvipdfmx.c

Modified: trunk/Build/source/texk/dvipdfm-x/ChangeLog
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/ChangeLog	2020-06-27 23:53:32 UTC (rev 55684)
+++ trunk/Build/source/texk/dvipdfm-x/ChangeLog	2020-06-28 09:01:20 UTC (rev 55685)
@@ -9,6 +9,8 @@
 	area when it encounters "horizontal movement" such as DVI
 	"right". Optionally height and depth of such area can be
 	specified (default: current font size for height and depth 0).
+	* pdfcolor.c: Change prefix for ColorSpace resource name to "XC".
+	* pdfdoc.c: Add missing release object.
 
 2020-06-27  Shunsaku Hirata  <shunsaku.hirata74 at gmail.com>
 

Modified: trunk/Build/source/texk/dvipdfm-x/pdfcolor.c
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/pdfcolor.c	2020-06-27 23:53:32 UTC (rev 55684)
+++ trunk/Build/source/texk/dvipdfm-x/pdfcolor.c	2020-06-28 09:01:20 UTC (rev 55685)
@@ -351,7 +351,7 @@
     {
       char res_name[16];
 
-      snprintf(res_name, 8, "CS_%d", color->res_id & 0xffff); /* TODO: Upper 16bits for category ID. See, pdfresource.c */
+      snprintf(res_name, 8, "XC%d", color->res_id & 0xffff); /* TODO: Upper 16bits for category ID. See, pdfresource.c */
       res_name[8] = 0;
       len += sprintf(buffer+len, " /%s %c%c", res_name, 'C' | mask, 'S' | mask);
       for (i = 0; i < color->num_components; i++) {

Modified: trunk/Build/source/texk/dvipdfm-x/pdfdoc.c
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/pdfdoc.c	2020-06-27 23:53:32 UTC (rev 55684)
+++ trunk/Build/source/texk/dvipdfm-x/pdfdoc.c	2020-06-28 09:01:20 UTC (rev 55685)
@@ -536,19 +536,15 @@
   pdf_obj *resources;
   pdf_obj *duplicate;
 
-#if 0
-  if (!PDF_OBJ_INDIRECTTYPE(resource_ref)) {
-    WARN("Passed non indirect reference...");
-    resource_ref = pdf_ref_obj(resource_ref); /* leak */
-  }
-#endif
   resources = pdf_doc_get_page_resources(p, category);
   duplicate = pdf_lookup_dict(resources, resource_name);
-  if (duplicate && pdf_compare_reference(duplicate, resource_ref)) {
-    WARN("Conflicting page resource found (page: %d, category: %s, name: %s).",
-         pdf_doc_current_page_number(), category, resource_name);
-    WARN("Ignoring...");
-    pdf_release_obj(resource_ref);
+  if (duplicate) {
+    if (pdf_compare_reference(duplicate, resource_ref)) {
+      WARN("Possibly two different resource using the same name... (page: %d, category: %s, name: %s).",
+           pdf_doc_current_page_number(), category, resource_name);
+      WARN("Ignoring...");
+    }
+    pdf_release_obj(resource_ref); /* Discard */
   } else {
     pdf_add_dict(resources, pdf_new_name(resource_name), resource_ref);
   }
@@ -2406,9 +2402,9 @@
 void
 pdf_doc_set_bgcolor (const pdf_color *color)
 {
-  if (color)
+  if (color) {
     pdf_color_copycolor(&bgcolor, color);
-  else { /* as clear... */
+  } else { /* as clear... */
     pdf_color_white(&bgcolor);
   }
 }

Modified: trunk/Build/source/texk/dvipdfm-x/spc_dvipdfmx.c
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/spc_dvipdfmx.c	2020-06-27 23:53:32 UTC (rev 55684)
+++ trunk/Build/source/texk/dvipdfm-x/spc_dvipdfmx.c	2020-06-28 09:01:20 UTC (rev 55685)
@@ -64,6 +64,8 @@
   skip_white(&args->curptr, args->endptr);
   if (mode == 1 && args->curptr < args->endptr) {
     transform_info ti;
+
+    transform_info_clear(&ti);
     error = spc_util_read_dimtrns(spe, &ti, args, 0);
     if (error)
       return -1;



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