~ubuntu-branches/ubuntu/jaunty/ghostscript/jaunty-updates

« back to all changes in this revision

Viewing changes to debian/patches/48_cups-output-device-pdf-duplex-uninitialized-memory-fix.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2009-01-20 16:40:45 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20090120164045-lnfhi0n30o5lwhwa
Tags: 8.64.dfsg.1~svn9377-0ubuntu1
* New upstream release (SVN rev 9377)
   o Fixes many bugs concerning PDF rendering, to make the PDF printing
     workflow correctly working.
   o Fixes long-standing bugs in many drivers, like input paper tray and
     duplex options not working for the built-in PCL 4, 5, 5c, 5e, and
     6/XL drivers, PDF input not working for bjc600, bjc800, and cups
     output devices, several options not working and uninitialized
     memory with cups output device.
   o Merged nearly all patches of the Ubuntu and Debian packages upstream.
   o Fixes LP: #317810, LP: #314439, LP: #314018.
* debian/patches/03_libpaper_support.dpatch,
  debian/patches/11_gs-cjk_font_glyph_handling_fix.dpatch,
  debian/patches/12_gs-cjk_vertical_writing_metrics_fix.dpatch,
  debian/patches/13_gs-cjk_cjkps_examples.dpatch,
  debian/patches/20_bbox_segv_fix.dpatch,
  debian/patches/21_brother_7x0_gdi_fix.dpatch,
  debian/patches/22_epsn_margin_workaround.dpatch,
  debian/patches/24_gs_man_fix.dpatch,
  debian/patches/25_toolbin_insecure_tmp_usage_fix.dpatch,
  debian/patches/26_assorted_script_fixes.dpatch,
  debian/patches/29_gs_css_fix.dpatch,
  debian/patches/30_ps2pdf_man_improvement.dpatch,
  debian/patches/31_fix-gc-sigbus.dpatch,
  debian/patches/34_ftbfs-on-hurd-fix.dpatch,
  debian/patches/35_disable_libcairo.dpatch,
  debian/patches/38_pxl-duplex.dpatch,
  debian/patches/39_pxl-resolution.dpatch,
  debian/patches/42_gs-init-ps-delaybind-fix.dpatch,
  debian/patches/45_bjc600-bjc800-pdf-input.dpatch,
  debian/patches/48_cups-output-device-pdf-duplex-uninitialized-memory-fix.dpatch,
  debian/patches/50_lips4-floating-point-exception.dpatch,
  debian/patches/52_cups-device-logging.dpatch,
  debian/patches/55_pcl-input-slot-fix.dpatch,
  debian/patches/57_pxl-input-slot-fix.dpatch,
  debian/patches/60_pxl-cups-driver-pdf.dpatch,
  debian/patches/62_onebitcmyk-pdf.dpatch,
  debian/patches/65_too-big-temp-files-1.dpatch,
  debian/patches/67_too-big-temp-files-2.dpatch,
  debian/patches/70_take-into-account-data-in-stream-buffer-before-refill.dpatch:
  Removed, applied upstream.
* debian/patches/01_docdir_fix_for_debian.dpatch,
  debian/patches/02_gs_man_fix_debian.dpatch,
  debian/patches/01_docdir-fix-for-debian.dpatch,
  debian/patches/02_docdir-fix-for-debian.dpatch: Renamed patches to
  make merging with Debian easier.
* debian/patches/32_improve-handling-of-media-size-changes-from-gv.dpatch, 
  debian/patches/33_bad-params-to-xinitimage-on-large-bitmaps.dpatch:
  regenerated for new source directory structure.
* debian/rules: Corrected paths to remove cidfmap (it is in Resource/Init/
  in GS 8.64) and to install headers (source paths are psi/ and base/ now).
* debian/rules: Remove all fontmaps, as DeFoMa replaces them.
* debian/local/pdftoraster/pdftoraster.c,
  debian/local/pdftoraster/pdftoraster.convs, debian/rules: Removed
  added pdftoraster filter and use the one which comes with Ghostscript.
* debian/ghostscript.links: s/8.63/8.64/

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh /usr/share/dpatch/dpatch-run
2
 
## 48_cups-output-device-pdf-duplex-uninitialized-memory-fix.dpatch by  <till.kamppeter@gmail.com>
3
 
##
4
 
## All lines beginning with `## DP:' are a description of the patch.
5
 
## DP: No description.
6
 
 
7
 
@DPATCH@
8
 
diff -urNad ghostscript-8.63.dfsg.1~/cups/gdevcups.c ghostscript-8.63.dfsg.1/cups/gdevcups.c
9
 
--- ghostscript-8.63.dfsg.1~/cups/gdevcups.c    2007-05-14 20:22:09.000000000 +0200
10
 
+++ ghostscript-8.63.dfsg.1/cups/gdevcups.c     2008-10-19 12:39:50.000000000 +0200
11
 
@@ -352,6 +352,21 @@
12
 
     0,                                 /* cupsRowCount */
13
 
     0,                                 /* cupsRowFeed */
14
 
     0                                  /* cupsRowStep */
15
 
+#ifdef CUPS_RASTER_SYNCv1
16
 
+    ,
17
 
+    1,                                  /* cupsNumColors */
18
 
+    1.0,                                /* cupsBorderlessScalingFactor */
19
 
+    { 612.0, 792.0 },                   /* cupsPageSize */
20
 
+    { 0.0, 0.0, 612.0, 792.0 },         /* cupsImagingBBox */
21
 
+    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* cupsInteger */
22
 
+    { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
23
 
+      0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, /* cupsReal */
24
 
+    { "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" },
25
 
+                                        /* cupsString */
26
 
+    "",                                 /* cupsMarkerType */
27
 
+    "",                                 /* cupsRenderingIntent */
28
 
+    "Letter"                            /* cupsPageSizeName */
29
 
+#endif /* CUPS_RASTER_SYNCv1 */
30
 
   }
31
 
 };
32
 
 
33
 
@@ -738,6 +753,10 @@
34
 
                               (int *)&(cups->header.CutMedia))) < 0)
35
 
     return (code);
36
 
 
37
 
+  b = cups->header.Duplex;
38
 
+  if ((code = param_write_bool(plist, "Duplex", &b)) < 0)
39
 
+    return (code);
40
 
+
41
 
   b = cups->header.InsertSheet;
42
 
   if ((code = param_write_bool(plist, "InsertSheet", &b)) < 0)
43
 
     return (code);
44
 
@@ -758,6 +777,10 @@
45
 
                               (int *)&(cups->header.MediaPosition))) < 0)
46
 
     return (code);
47
 
 
48
 
+  if ((code = param_write_int(plist, "MediaWeight",
49
 
+                              (int *)&(cups->header.MediaWeight))) < 0)
50
 
+    return (code);
51
 
+
52
 
   b = cups->header.MirrorPrint;
53
 
   if ((code = param_write_bool(plist, "MirrorPrint", &b)) < 0)
54
 
     return (code);
55
 
@@ -833,9 +856,11 @@
56
 
     return (code);
57
 
 
58
 
 #ifdef CUPS_RASTER_SYNCv1
59
 
+#if 0 /* Don't include read-only parameters... */
60
 
   if ((code = param_write_int(plist, "cupsNumColors",
61
 
                               (int *)&(cups->header.cupsNumColors))) < 0)
62
 
     return (code);
63
 
+#endif /* 0 */
64
 
 
65
 
   if ((code = param_write_float(plist, "cupsBorderlessScalingFactor",
66
 
                                &(cups->header.cupsBorderlessScalingFactor))) < 0)
67
 
@@ -844,7 +869,7 @@
68
 
   for (i = 0; i < 16; i ++)
69
 
   {
70
 
     sprintf(name, "cupsInteger%d", i);
71
 
-    if ((code = param_write_int(plist, name,
72
 
+    if ((code = param_write_int(plist, strdup(name),
73
 
                                (int *)(cups->header.cupsInteger + i))) < 0)
74
 
       return (code);
75
 
   }
76
 
@@ -852,16 +877,16 @@
77
 
   for (i = 0; i < 16; i ++)
78
 
   {
79
 
     sprintf(name, "cupsReal%d", i);
80
 
-    if ((code = param_write_float(plist, name,
81
 
+    if ((code = param_write_float(plist, strdup(name),
82
 
                                  cups->header.cupsReal + i)) < 0)
83
 
       return (code);
84
 
   }
85
 
 
86
 
   for (i = 0; i < 16; i ++)
87
 
   {
88
 
-    sprintf(name, "cupsReal%d", i);
89
 
+    sprintf(name, "cupsString%d", i);
90
 
     param_string_from_string(s, cups->header.cupsString[i]);
91
 
-    if ((code = param_write_string(plist, name, &s)) < 0)
92
 
+    if ((code = param_write_string(plist, strdup(name), &s)) < 0)
93
 
       return (code);
94
 
   }
95
 
 
96
 
@@ -2695,11 +2720,15 @@
97
 
 #define stringoption(name, sname) \
98
 
   if ((code = param_read_string(plist, sname, &stringval)) < 0) \
99
 
   { \
100
 
+    dprintf2("ERROR: Error setting %s to \"%s\"...\n", sname, \
101
 
+             (char *)stringval.data); \
102
 
     param_signal_error(plist, sname, code); \
103
 
     return (code); \
104
 
   } \
105
 
   else if (code == 0) \
106
 
   { \
107
 
+    dprintf2("DEBUG: Setting %s to \"%s\"...\n", sname, \
108
 
+             (char *)stringval.data); \
109
 
     strncpy(cups->header.name, (const char *)stringval.data, \
110
 
             stringval.size); \
111
 
     cups->header.name[stringval.size] = '\0'; \
112
 
@@ -2708,29 +2737,35 @@
113
 
 #define intoption(name, sname, type) \
114
 
   if ((code = param_read_int(plist, sname, &intval)) < 0) \
115
 
   { \
116
 
+    dprintf2("ERROR: Error setting %s to %d...\n", sname, (int)intval); \
117
 
     param_signal_error(plist, sname, code); \
118
 
     return (code); \
119
 
   } \
120
 
   else if (code == 0) \
121
 
   { \
122
 
-    dprintf2("DEBUG: Setting %s to %d...\n", sname, intval); \
123
 
+    dprintf2("DEBUG: Setting %s to %d...\n", sname, (int)intval); \
124
 
     cups->header.name = (type)intval; \
125
 
   }
126
 
 
127
 
 #define floatoption(name, sname) \
128
 
   if ((code = param_read_float(plist, sname, &floatval)) < 0) \
129
 
   { \
130
 
+    dprintf2("ERROR: Error setting %s to %.4f...\n", sname, (float)floatval); \
131
 
     param_signal_error(plist, sname, code); \
132
 
     return (code); \
133
 
   } \
134
 
   else if (code == 0) \
135
 
-    cups->header.name = (unsigned)floatval;
136
 
+  { \
137
 
+    dprintf2("DEBUG: Setting %s to %.4f...\n", sname, (float)floatval);        \
138
 
+    cups->header.name = (float)floatval; \
139
 
+  }
140
 
 
141
 
 #define booloption(name, sname) \
142
 
   if ((code = param_read_bool(plist, sname, &boolval)) < 0) \
143
 
   { \
144
 
     if ((code = param_read_null(plist, sname)) < 0) \
145
 
     { \
146
 
+      dprintf2("ERROR: Error setting %s to %d...\n", sname, (int)boolval); \
147
 
       param_signal_error(plist, sname, code); \
148
 
       return (code); \
149
 
     } \
150
 
@@ -2738,24 +2773,34 @@
151
 
       cups->header.name = CUPS_FALSE; \
152
 
   } \
153
 
   else if (code == 0) \
154
 
-    cups->header.name = (cups_bool_t)boolval;
155
 
+  { \
156
 
+    dprintf2("DEBUG: Setting %s to %d...\n", sname, (int)boolval); \
157
 
+    cups->header.name = (cups_bool_t)boolval; \
158
 
+  }
159
 
 
160
 
 #define arrayoption(name, sname, count) \
161
 
   if ((code = param_read_float_array(plist, sname, &arrayval)) < 0) \
162
 
   { \
163
 
     if ((code = param_read_null(plist, sname)) < 0) \
164
 
     { \
165
 
+      dprintf1("ERROR: Error setting %s...\n", sname); \
166
 
       param_signal_error(plist, sname, code); \
167
 
       return (code); \
168
 
     } \
169
 
     if (code == 0) \
170
 
+    { \
171
 
+      dprintf1("DEBUG: Setting %s to zero\n", sname); \
172
 
       for (i = 0; i < count; i ++) \
173
 
        cups->header.name[i] = 0; \
174
 
+    } \
175
 
   } \
176
 
   else if (code == 0) \
177
 
   { \
178
 
+    dprintf1("DEBUG: Setting %s to", sname); \
179
 
     for (i = 0; i < count; i ++) \
180
 
+      dprintf1(" %d", (unsigned)(arrayval.data[i]));    \
181
 
       cups->header.name[i] = (unsigned)arrayval.data[i]; \
182
 
+    dprintf("...\n"); \
183
 
   }
184
 
 
185
 
   size_set    = param_read_float_array(plist, ".MediaSize", &arrayval) == 0 ||
186
 
@@ -2768,7 +2813,7 @@
187
 
   stringoption(MediaColor, "MediaColor")
188
 
   stringoption(MediaType, "MediaType")
189
 
   stringoption(OutputType, "OutputType")
190
 
-  floatoption(AdvanceDistance, "AdvanceDistance")
191
 
+  intoption(AdvanceDistance, "AdvanceDistance", unsigned)
192
 
   intoption(AdvanceMedia, "AdvanceMedia", cups_adv_t)
193
 
   booloption(Collate, "Collate")
194
 
   intoption(CutMedia, "CutMedia", cups_cut_t)
195
 
@@ -2781,7 +2826,7 @@
196
 
   booloption(ManualFeed, "ManualFeed")
197
 
   intoption(MediaPosition, "cupsMediaPosition", unsigned) /* Compatibility */
198
 
   intoption(MediaPosition, "MediaPosition", unsigned)
199
 
-  floatoption(MediaWeight, "MediaWeight")
200
 
+  intoption(MediaWeight, "MediaWeight", unsigned)
201
 
   booloption(MirrorPrint, "MirrorPrint")
202
 
   booloption(NegativePrint, "NegativePrint")
203
 
   intoption(Orientation, "Orientation", cups_orient_t)
204
 
@@ -2815,19 +2860,19 @@
205
 
   for (i = 0; i < 16; i ++)
206
 
   {
207
 
     sprintf(name, "cupsInteger%d", i);
208
 
-    intoption(cupsInteger[i], name, unsigned)
209
 
+    intoption(cupsInteger[i],strdup(name), unsigned)
210
 
   }
211
 
 
212
 
   for (i = 0; i < 16; i ++)
213
 
   {
214
 
     sprintf(name, "cupsReal%d", i);
215
 
-    floatoption(cupsReal[i], name)
216
 
+    floatoption(cupsReal[i], strdup(name))
217
 
   }
218
 
 
219
 
   for (i = 0; i < 16; i ++)
220
 
   {
221
 
     sprintf(name, "cupsString%d", i);
222
 
-    stringoption(cupsString[i], name)
223
 
+    stringoption(cupsString[i], strdup(name))
224
 
   }
225
 
 
226
 
   stringoption(cupsMarkerType, "cupsMarkerType");