[arch-commits] Commit in ghostscript/trunk (PKGBUILD svn_r10890.patch)
andyrtr at archlinux.org
andyrtr at archlinux.org
Sun Mar 21 21:20:23 UTC 2010
Date: Sunday, March 21, 2010 @ 17:20:23
Author: andyrtr
Revision: 73021
upgpkg: ghostscript 8.71-3
fix a segfault, closes #18339
Added:
ghostscript/trunk/svn_r10890.patch
Modified:
ghostscript/trunk/PKGBUILD
------------------+
PKGBUILD | 14 +++++--
svn_r10890.patch | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 109 insertions(+), 4 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2010-03-21 20:29:12 UTC (rev 73020)
+++ PKGBUILD 2010-03-21 21:20:23 UTC (rev 73021)
@@ -3,7 +3,7 @@
pkgname=ghostscript
pkgver=8.71
-pkgrel=2
+pkgrel=3
pkgdesc="An interpreter for the PostScript language"
arch=('i686' 'x86_64')
license=('GPL3' 'custom')
@@ -19,13 +19,15 @@
ghostscript-fPIC.patch
ghostscript-system-jasper.patch
libpng14.patch
- ghostscript-pdf2dsc.patch)
-options=('!libtool') # '!makeflags')
+ ghostscript-pdf2dsc.patch
+ svn_r10890.patch)
+options=('!libtool' '!makeflags')
md5sums=('5005d68f7395c2bfc4b05c1a60d9b6ba'
'1a8fcacf0005214db823225c870f093d'
'03e27cd02471ab3b642c344fa06b623e'
'be94ee357986f7f63d1b470da5bdc99e'
- 'f88f3764fc11e3ae2a86b17d2502da2f')
+ 'f88f3764fc11e3ae2a86b17d2502da2f'
+ 'fe0888a74d7870af234ad53a2f74380a')
build() {
cd ${srcdir}/ghostscript-${pkgver}
@@ -39,7 +41,11 @@
# fix PDF viewing with gv - from Fedora
patch -Np1 -i ${srcdir}/ghostscript-pdf2dsc.patch || return 1
+
+ # fix segfaults - http://bugs.archlinux.org/task/18339
+ patch -Np1 -i ${srcdir}/svn_r10890.patch || return 1
+
if [ "$CARCH" = "x86_64" ]; then
patch -Np1 -i ${srcdir}/ghostscript-fPIC.patch || return 1
fi
Added: svn_r10890.patch
===================================================================
--- svn_r10890.patch (rev 0)
+++ svn_r10890.patch 2010-03-21 21:20:23 UTC (rev 73021)
@@ -0,0 +1,99 @@
+From 6d26e9b1c38d8c0f0ab4af42c513cb23f3ae1656 Mon Sep 17 00:00:00 2001
+From: till <till at a1074d23-0009-0410-80fe-cf8c14f379e6>
+Date: Tue, 9 Mar 2010 16:35:06 +0000
+Subject: [PATCH] Fixes on CUPS Raster output device:
+ - Fixed memory reallocation on bitmap size change. Reallocation is not only
+ needed when dimendions and margins change, but also when the color depth
+ changes. Fixes bugs #691029 and #691108.
+ - Fixed arrayoption() macro in cups_put_params() function. Array values did
+ not get actually set in cups.header data structure. Bug only showed via
+ a compiler warning.
+ - Silenced compiler warning by presetting c0..c3 in cups_map_cmyk() to zero.
+
+git-svn-id: http://svn.ghostscript.com/ghostscript/trunk/gs@10890 a1074d23-0009-0410-80fe-cf8c14f379e6
+---
+ cups/gdevcups.c | 32 +++++++++++++++++++++++---------
+ 1 files changed, 23 insertions(+), 9 deletions(-)
+
+diff --git a/cups/gdevcups.c b/cups/gdevcups.c
+index 551b806..4000abf 100644
+--- a/cups/gdevcups.c
++++ b/cups/gdevcups.c
+@@ -975,7 +975,8 @@ cups_map_cmyk(gx_device *pdev, /* I - Device info */
+ frac k, /* I - Black value */
+ frac *out) /* O - Device colors */
+ {
+- int c0, c1, c2, c3; /* Temporary color values */
++ int c0 = 0, c1 = 0,
++ c2 = 0, c3 = 0; /* Temporary color values */
+ float rr, rg, rb, /* Real RGB colors */
+ ciex, ciey, ciez, /* CIE XYZ colors */
+ ciey_yn, /* Normalized luminance */
+@@ -2703,9 +2704,13 @@ cups_put_params(gx_device *pdev, /* I - Device info */
+ int color_set; /* Were the color attrs set? */
+ gdev_prn_space_params sp; /* Space parameter data */
+ int width, /* New width of page */
+- height; /* New height of page */
++ height, /* New height of page */
++ colorspace, /* New color space */
++ bitspercolor; /* New bits per color */
+ static int width_old = 0, /* Previous width */
+- height_old = 0; /* Previous height */
++ height_old = 0, /* Previous height */
++ colorspace_old = 0,/* Previous color space */
++ bitspercolor_old = 0;/* Previous bits per color */
+ ppd_attr_t *backside = NULL,
+ *backsiderequiresflippedmargins = NULL;
+ float swap;
+@@ -2800,9 +2805,10 @@ cups_put_params(gx_device *pdev, /* I - Device info */
+ else if (code == 0) \
+ { \
+ dprintf1("DEBUG: Setting %s to", sname); \
+- for (i = 0; i < count; i ++) \
+- dprintf1(" %d", (unsigned)(arrayval.data[i])); \
+- cups->header.name[i] = (unsigned)arrayval.data[i]; \
++ for (i = 0; i < count; i ++) { \
++ dprintf1(" %d", (unsigned)(arrayval.data[i])); \
++ cups->header.name[i] = (unsigned)(arrayval.data[i]); \
++ } \
+ dprintf("...\n"); \
+ }
+
+@@ -3243,23 +3249,31 @@ cups_put_params(gx_device *pdev, /* I - Device info */
+ }
+ #endif /* CUPS_RASTER_SYNCv1 */
+
++ colorspace = cups->header.cupsColorSpace;
++ bitspercolor = cups->header.cupsBitsPerColor;
++
+ /*
+ * Don't reallocate memory unless the device has been opened...
+ * Also reallocate only if the size has actually changed...
+ */
+
+- if (pdev->is_open && (width != width_old || height != height_old))
++ if (pdev->is_open &&
++ (width != width_old || height != height_old ||
++ colorspace != colorspace_old || bitspercolor != bitspercolor_old))
+ {
+
+ width_old = width;
+ height_old = height;
++ colorspace_old = colorspace;
++ bitspercolor_old = bitspercolor;
+
+ /*
+ * Device is open and size has changed, so reallocate...
+ */
+
+- dprintf4("DEBUG2: Reallocating memory, [%.0f %.0f] = %dx%d pixels...\n",
+- pdev->MediaSize[0], pdev->MediaSize[1], width, height);
++ dprintf6("DEBUG2: Reallocating memory, [%.0f %.0f] = %dx%d pixels, color space: %d, bits per color: %d...\n",
++ pdev->MediaSize[0], pdev->MediaSize[1], width, height,
++ colorspace, bitspercolor);
+
+ sp = ((gx_device_printer *)pdev)->space_params;
+
+--
+1.6.6.1
+
More information about the arch-commits
mailing list