[gs-cvs] rev 7631 - in trunk/gs: lib src

lpd at ghostscript.com lpd at ghostscript.com
Sun Jan 21 19:26:28 PST 2007


Author: lpd
Date: 2007-01-21 19:26:28 -0800 (Sun, 21 Jan 2007)
New Revision: 7631

Modified:
   trunk/gs/lib/gs_btokn.ps
   trunk/gs/src/iscanbin.c
   trunk/gs/src/zbseq.c
Log:
Fixes bug: writeobject/printobject didn't zero out the 'unused' fields in
marks and nulls.  (PS3 CET 23-36-2)


Modified: trunk/gs/lib/gs_btokn.ps
===================================================================
--- trunk/gs/lib/gs_btokn.ps	2007-01-22 02:44:19 UTC (rev 7630)
+++ trunk/gs/lib/gs_btokn.ps	2007-01-22 03:26:28 UTC (rev 7631)
@@ -201,7 +201,7 @@
   } {
 	% Use the long header format: tag 0(1) toplen(2) totlen(4)
     exch 8 add exch
-    0 0 4 2 roll .bosobject exch pop exch pop	% store with byte swapping
+     0 0 4 2 roll .bosobject exch pop exch pop	% store with byte swapping
   } ifelse		% Stack: shortlen str
   exch dup -8 bitshift exch 255 and	% str hibyte lobyte
   currentobjectformat 1 and 0 eq {	% lsb first
@@ -245,7 +245,7 @@
 	3 index exch writestring
       } forall
     } {
-      { (xxxxxxxx) .bosobject
+      { (x\000xxxxxx) .bosobject
 	dup 1 6 index put
 	3 index exch writestring
 	4 -1 roll pop 0 4 1 roll	% clear tag

Modified: trunk/gs/src/iscanbin.c
===================================================================
--- trunk/gs/src/iscanbin.c	2007-01-22 02:44:19 UTC (rev 7630)
+++ trunk/gs/src/iscanbin.c	2007-01-22 03:26:28 UTC (rev 7631)
@@ -751,6 +751,11 @@
 
 /* ---------------- Writing ---------------- */
 
+/*
+ * Encode a single object for a binary object sequence, for printobject and
+ * write object.  Note that this does not modify the always-unused byte (1),
+ * but it always write bytes 0 and 2-7.
+ */
 int
 encode_binary_token(i_ctx_t *i_ctx_p, const ref *obj, long *ref_offset,
 		    long *char_offset, byte *str)
@@ -758,16 +763,16 @@
     bin_seq_type_t type;
     uint size = 0;
     int format = (int)ref_binary_object_format.value.intval;
-    long value;
+    long value = 0;
     ref nstr;
 
     switch (r_type(obj)) {
 	case t_null:
 	    type = BS_TYPE_NULL;
-	    goto tx;
+	    break;		/* always set all fields */
 	case t_mark:
 	    type = BS_TYPE_MARK;
-	    goto tx;
+	    break;		/* always set all fields */
 	case t_integer:
 	    type = BS_TYPE_INTEGER;
 	    value = obj->value.intval;

Modified: trunk/gs/src/zbseq.c
===================================================================
--- trunk/gs/src/zbseq.c	2007-01-22 02:44:19 UTC (rev 7630)
+++ trunk/gs/src/zbseq.c	2007-01-22 03:26:28 UTC (rev 7631)
@@ -111,7 +111,7 @@
  * representation, doing the dirty work of printobject and writeobject.
  * (The main control is in PostScript code, so that we don't have to worry
  * about interrupts or callouts in the middle of writing the various data
- * items.)  Note that this may or may not modify the 'unused' field.
+ * items.)  See encode_binary_token for more details.
  */
 
 private int



More information about the gs-cvs mailing list