[tex-live] Small bug in dvipdfm-x/pdfobj.c

Richard M Kreuter kreuter at progn.net
Sat May 10 22:26:05 CEST 2014


It looks like pdf_unshift_array in Build/source/texk/dvipdfm-x/pdfobj.c
clobbers all array elements above index 0. Patch below.

(Note, I'm using git-svn to track just Build/source, and I don't
remember how to produce an SVN-aware diff. If this is a blocker, please
let me know and I'll see if I can't figure out how to get you a
differently formatted patch.)

Thank you,

--- a/texk/dvipdfm-x/pdfobj.c
+++ b/texk/dvipdfm-x/pdfobj.c
@@ -1286,8 +1286,8 @@ pdf_unshift_array (pdf_obj *array, pdf_obj *object)
     data->max   += ARRAY_ALLOC_SIZE;
     data->values = RENEW(data->values, data->max, pdf_obj *);
-  for (i = 0; i < data->size; i++)
-    data->values[i+1] = data->values[i];
+  for (i = data->size; i > 0; i--)
+    data->values[i] = data->values[i-1];
   data->values[0] = object;

More information about the tex-live mailing list