[gs-cvs] gs/src

L. Peter Deutsch lpd at casper.ghostscript.com
Mon Jun 24 21:32:50 PDT 2002


Update of /cvs/ghostscript/gs/src
In directory casper:/tmp/cvs-serv11331/src

Modified Files:
	gxfcopy.c 
Log Message:

Fixes an off-by-1 error in copying [Global]Subrs.


Index: gxfcopy.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gxfcopy.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- gxfcopy.c	24 Jun 2002 23:48:31 -0000	1.6
+++ gxfcopy.c	25 Jun 2002 04:32:48 -0000	1.7
@@ -57,9 +57,9 @@
  * and the GlobalSubrs data for all but Type 1.
  */
 typedef struct gs_subr_info_s {
-    byte *data;			/* Subr data */
-    uint *starts;		/* Subr[i] = data[starts[i]..starts[i+1]] */
-    int count;			/* start is [count+1] */
+    byte *data;		/* Subr data */
+    int count;
+    uint *starts;	/* [count+1] Subr[i] = data[starts[i]..starts[i+1]] */
 } gs_subr_info_t;
 
 /*
@@ -241,7 +241,7 @@
 	gs_glyph_data_free(&gdata, "copy_subrs");
     }
     if (size == 0)
-	data = 0, starts = 0, i = -1;
+	data = 0, starts = 0, i = 0;
     else {
 	/* Allocate the copy. */
 	data = gs_alloc_bytes(mem, size, "copy_subrs(data)");
@@ -268,7 +268,7 @@
 
     psi->data = data;
     psi->starts = starts;
-    psi->count = i + 1;
+    psi->count = i;
     return 0;
 }
 




More information about the gs-cvs mailing list