--- ghostscript-8.71.dfsg.1.orig/debian/ghostscript-cups.postinst +++ ghostscript-8.71.dfsg.1/debian/ghostscript-cups.postinst @@ -0,0 +1,79 @@ +#! /bin/sh +# postinst script for ghostscript-cups +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package +# + +case "$1" in + configure) + # Do the following only if CUPS is running and the needed CUPS tools + # are available + if which lpstat > /dev/null 2>&1 && \ + which lpinfo > /dev/null 2>&1 && \ + which lpadmin > /dev/null 2>&1 && \ + LC_ALL=C lpstat -h /var/run/cups/cups.sock -r | grep -v not > /dev/null 2>&1; then + # Update the PPD files of all already installed print queues + driverregexp='lsb/usr/ghostscript/' + gennicknameregexp='' + [ ! -z "$gennicknameregexp" ] && \ + gennicknameregexp="; $gennicknameregexp" + gennicknameregexp='s/\s*\(recommended\)//'"$gennicknameregexp" + tempfiles= + trap 'rm -f $tempfiles; exit 0' 0 HUP INT QUIT ILL ABRT PIPE TERM + tmpfile1=`mktemp -t updateppds.XXXXXX` + tempfiles="$tempfiles $tmpfile1" + lpinfo -h /var/run/cups/cups.sock -m | grep -E $driverregexp > $tmpfile1 + cd /etc/cups/ppd + for ppd in *.ppd; do + [ -r "$ppd" ] || continue + queue=${ppd%.ppd} + lpstat -h /var/run/cups/cups.sock -p "$queue" >/dev/null 2>&1 || continue + nickname=`grep '\*NickName:' "$ppd" | cut -d '"' -f 2 | perl -p -e 's/\n$//' | perl -p -e "$gennicknameregexp" | perl -p -e 's/(\W)/\\\\$1/g'` + lang=`grep '\*LanguageVersion:' "$ppd" | cut -d ' ' -f 2 | perl -e 'print lc(<>)' | perl -p -e 's/[\r\n]//gs'` + ppdfound="0" + englishppduri="" + tmpfile2=`mktemp -t updateppds.XXXXXX` + tempfiles="$tempfiles $tmpfile2" + cat $tmpfile1 | perl -p -e "$gennicknameregexp" | grep -E '^\S+\s+.*'"$nickname"'$' | cut -d ' ' -f 1 > $tmpfile2 + while read newppduri; do + [ "$ppdfound" = "0" ] && lpadmin -h /var/run/cups/cups.sock -p "$queue" -m $newppduri 2>/dev/null || continue + newlang=`grep '\*LanguageVersion:' "$ppd" | cut -d ' ' -f 2 | perl -e 'print lc(<>)' | perl -p -e 's/[\r\n]//gs'` + [ "$newlang" = "$lang" ] && ppdfound="1" + [ "$newlang" = "english" ] && englishppduri="$newppduri" + done < $tmpfile2 + [ "$ppdfound" = "0" ] && [ ! -z "$englishppduri" ] && lpadmin -h /var/run/cups/cups.sock -p "$queue" -m $englishppduri 2>/dev/null && ppdfound="1" + [ "$ppdfound" = "1" ] && echo PPD for printer $queue updated >&2 + done + fi + + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 --- ghostscript-8.71.dfsg.1.orig/debian/gs-gpl.preinst +++ ghostscript-8.71.dfsg.1/debian/gs-gpl.preinst @@ -0,0 +1,45 @@ +#!/bin/sh +# preinst script for gs-afpl +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) + # Do away with update-alternative for /usr/bin/gs, we have one + # grand unified Ghostscript now! + if dpkg --compare-versions "$2" lt-nl "8.63.dfsg.1-1"; then + update-alternatives --remove-all gs || true + update-alternatives --remove-all gs.1 || true + fi + + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- ghostscript-8.71.dfsg.1.orig/debian/ghostscript.links +++ ghostscript-8.71.dfsg.1/debian/ghostscript.links @@ -0,0 +1,14 @@ +var/lib/defoma/gs.d/dirs/CMap usr/share/ghostscript/8.71/Resource/CMap +var/lib/defoma/gs.d/dirs/CMap usr/share/ghostscript/CMap +usr/bin/ps2ascii usr/bin/ps2txt +usr/share/man/de/man1/ps2ps.1.gz usr/share/man/de/man1/eps2eps.1.gz +usr/share/man/de/man1/ps2pdf.1.gz usr/share/man/de/man1/ps2pdf12.1.gz +usr/share/man/de/man1/ps2pdf.1.gz usr/share/man/de/man1/ps2pdf13.1.gz +usr/share/man/man1/ps2ps.1.gz usr/share/man/man1/eps2eps.1.gz +usr/share/man/man1/gslp.1.gz usr/share/man/man1/gsbj.1.gz +usr/share/man/man1/gslp.1.gz usr/share/man/man1/gsdj.1.gz +usr/share/man/man1/gslp.1.gz usr/share/man/man1/gsdj500.1.gz +usr/share/man/man1/gslp.1.gz usr/share/man/man1/gslj.1.gz +usr/share/man/man1/ps2pdf.1.gz usr/share/man/man1/ps2pdf12.1.gz +usr/share/man/man1/ps2pdf.1.gz usr/share/man/man1/ps2pdf13.1.gz +usr/share/man/man1/ps2pdf.1.gz usr/share/man/man1/ps2pdf14.1.gz --- ghostscript-8.71.dfsg.1.orig/debian/gs.defoma +++ ghostscript-8.71.dfsg.1/debian/gs.defoma @@ -0,0 +1,930 @@ +# +# gs.defoma: Defoma support for Ghostscripts +# + +@ACCEPT_CATEGORIES = qw(type1 type3 gsfontderivative truetype cid + cmap psprint); + +package gs; +use strict; +use POSIX; + +use vars qw($DEFOMA_TEST_DIR $ROOTDIR); + +use Debian::Defoma::Common; +use Debian::Defoma::Font; +use Debian::Defoma::Id; +use Debian::Defoma::Subst; +import Debian::Defoma::Font; +import Debian::Defoma::Id; +import Debian::Defoma::Subst; +import Debian::Defoma::Common; + +my $Id; +my $IdCmap; +my $Sb1; +my $Sb2; + +my $PkgDir = "$ROOTDIR/gs.d"; +my $CidDir = "$PkgDir/dirs/CIDFont"; +my $CMapDir = "$PkgDir/dirs/CMap"; +my $TTCidDir = "$PkgDir/dirs/TTCIDFont"; +my $FontDir = "$PkgDir/dirs/fonts"; +my $FontMap = "$FontDir/Fontmap"; # F +my $CIDFontMap = "$FontDir/CIDFnmap"; # FF +my $Subst4psprint = 0; +# For Ghostscript 8 or later +my $FAPIfmap = "$FontDir/FAPIfontmap"; # FFF +my $Cidfmap = "$FontDir/cidfmap"; # FFFF + +sub init { + unless ($Id) { + $Id = defoma_id_open_cache(); + } + unless ($IdCmap) { + $IdCmap = defoma_id_open_cache('cmap'); + } + unless ($Sb1) { + $Sb1 = defoma_subst_open(rulename => 'psprint', threshold => 50, + idobject => $Id, private => 1); + } + unless ($Sb2) { + $Sb2 = defoma_subst_open(rulename => 'ghostscript', threshold => 30, + idobject => $Id); + } + + return 0; +} + +sub term { + my @list; + my $i; + + if ($Id) { + if (open(F, '>' . $FontMap) && open(FF, '>' . $CIDFontMap) && + open(FFF, '>' . $FAPIfmap) && open(FFFF, '>' . $Cidfmap)) { + @list = defoma_id_get_font($Id, 'installed'); + + foreach $i (@list) { + next if ($Id->{2}->[$i] ne 'SrI'); + my $c = $Id->{4}->[$i]; + my $f; + my @h; + my $cmap; + my @cmaplist; + my $j; + my @ch; + my %hh; + + if ($c =~ /^(type1|type3|gsfontderivative)$/) { + $f = $Id->{1}->[$i]; + $f =~ s/^.*\///; + # + # Spit out $FontDir/Fontmap + # + print F '/', $Id->{0}->[$i], ' (', $f, ") ;\n"; + } elsif ($c =~ /^truetype$/) { + $f = $Id->{1}->[$i]; + # + # Spit out $FontDir/FAPIfontmap + # + # FIXME: need to support the sub font id for the collection. + print FFF '/', $Id->{0}->[$i], ' << /Path (', $f, ') /FontType 1 /FAPI /FreeType /SubfontId ', '0' , " >> ;\n" + } elsif ($c =~ /^(truetype-cjk|cid)$/) { + $f = $Id->{1}->[$i]; + @h = split(/ +/, $Id->{7}->[$i]); + # + # Spit out $FontDir/CIDFnmap + # + print FF '/', $Id->{0}->[$i], ' (', $f, ') '; + if ($c eq 'truetype-cjk') { + print FF '/', $h[0], '-', $h[1], '-', $h[2]; + } + print FF " ;\n"; + # For Ghostscript 8 or later + if ($c eq 'truetype-cjk') { + my @hints = defoma_id_get_hints( $Id, $i ); + my $cidsupplement; + while (@hints) { + my $var = shift @hints; + if ($var eq "--CIDSupplement") { + $cidsupplement = shift @hints; + last; + } + } + unless (defined $cidsupplement) { + print STDERR "No CIDSupplement specified for $Id->{0}->[$i], defaulting to 0.\n"; + $cidsupplement = 0; + } + # + # Spit out $FontDir/cidfmap + # + # FIXME: need to support the sub font id for the collection. + print FFFF '/', $Id->{0}->[$i], ' << /FileType /TrueType /Path (', $f, ') /SubfontID ', '0', ' /CSI [(', $h[6], ') ', $cidsupplement, "] >> ;\n"; + } + } + } + + @list = defoma_id_get_font($Id, 'installed'); + + foreach $i (@list) { + next if ($Id->{2}->[$i] !~ /^.[aS]/); + + my $c = $Id->{4}->[$i]; + # + # Spit out aliases + # + if ($c =~ /^(truetype|type1|type3|gsfontderivative)$/) { + print F '/', $Id->{0}->[$i], ' /', $Id->{5}->[$i], " ; \n"; + print FFF '/', $Id->{0}->[$i], ' /', $Id->{5}->[$i], " ; \n"; + } elsif ($c =~ /^(truetype-cjk|cid)$/) { + print FF '/', $Id->{0}->[$i], ' /', $Id->{5}->[$i], " ;\n"; + print FFFF '/', $Id->{0}->[$i], ' /', $Id->{5}->[$i], " ;\n"; + } + + } + + close F; + close FF; + close FFF; + close FFFF; + unlink($FontMap) unless(-s $FontMap); + unlink($CIDFontMap) unless(-s $CIDFontMap); + unlink($FAPIfmap) unless(-s $FAPIfmap); + unlink($Cidfmap) unless(-s $Cidfmap); + } + + defoma_id_close_cache($Id); + $Id = 0; + } + if ($IdCmap) { + defoma_id_close_cache($IdCmap); + $IdCmap = 0; + } + if ($Sb1) { + defoma_subst_close($Sb1); + $Sb1 = 0; + } + if ($Sb2) { + defoma_subst_close($Sb2); + $Sb2 = 0; + } + + return 0; +} + +sub create_symlink { + my $font = shift; + my $dir = shift || $FontDir; + + if ($font =~ /^(.*)\/(.+)$/) { + my $fontpath = $1; + my $fontfile = $2; + my $newfile = $dir . '/' . $fontfile; + + return 1 if (-e $newfile); + + symlink($font, $newfile) || return 1; + } else { + return 1; + } + + return 0; +} + +sub remove_symlink { + my $font = shift; + my $dir = shift || $FontDir; + + if ($font =~ /^(.*)\/(.+)$/) { + my $fontpath = $1; + my $fontfile = $2; + my $newfile = $dir . '/' . $fontfile; + + return 1 unless (-l $newfile); + + unlink($newfile); + } else { + return 1; + } + + return 0; +} + +sub register_ps { + my $id = shift; + + defoma_font_register('postscript', '/' . $id, @_); +} + +sub unregister_ps { + my $id = shift; + + if (defoma_font_if_register('postscript', '/' . $id)) { + defoma_font_unregister('postscript', '/' . $id); + } +} + +sub t1_register { + my $type = shift; + my $font = shift; + my $h = parse_hints_start(@_); + + my $fontname = $h->{FontName}; + return 1 unless ($fontname); + $fontname =~ s/ .*//; + + my $priority = $h->{Priority} || 0; + + my %add; + $add{hints} = join(' ', @_); + + if ($type eq 'gsfontderivative') { + my $ofont = $h->{'GSF-OriginFont'}; + my $oid = $h->{'GSF-OriginID'}; + + if ($ofont && $oid) { + $add{depend} = $ofont.' '.$oid; + } else { + return 2; + } + } + + return 3 if (create_symlink($font)); + + defoma_id_register($Id, type => 'real', font => $font, id => $fontname, + priority => $priority, %add); + + my @alias = ($h->{Alias}) ? split(/ +/, $h->{Alias}) : (); + my $i; + + foreach $i (@alias) { + defoma_id_register($Id, type => 'alias', font => $font, id => $i, + priority => $priority, origin => $fontname); + } + + defoma_subst_register($Sb1, $font, $fontname); + defoma_subst_register($Sb2, $font, $fontname); + + return 0; +} + +sub t1_unregister { + my $font = shift; + + defoma_subst_unregister($Sb1, $font); + defoma_subst_unregister($Sb2, $font); + defoma_id_unregister($Id, type => 'alias', font => $font); + defoma_id_unregister($Id, type => 'real', font => $font); + + remove_symlink($font); + + return 0; +} + +sub t1_install { + my $type = shift; + my $font = shift; + my $id = shift; + my $depfont = shift; + my $depid = shift; + my @add = (); + + if ($type eq 'real') { + return 0 if (grep($_ eq '--Alias', @_)); + + $add[0] = '--RealName'; + } + + register_ps($id, @_, @add); + + return 0; +} + +sub t1_remove { + my $type = shift; + my $font = shift; + my $id = shift; + my $depfont = shift; + my $depid = shift; + + unregister_ps($id); + + return 0; +} + +sub type1 { + my $com = shift; + + if ($com eq 'register') { + return t1_register('type1', @_); + } elsif ($com eq 'unregister') { + return t1_unregister(@_); + } elsif ($com =~ /^do-install-(.*)$/) { + return t1_install($1, @_); + } elsif ($com =~ /^do-remove-(.*)$/) { + return t1_remove($1, @_); + } elsif ($com eq 'init') { + return init(); + } elsif ($com eq 'term') { + return term(); + } + + return 0; +} + +sub type3 { + return type1(@_); +} + +sub gsfontderivative { + my $com = shift; + + if ($com eq 'register') { + return t1_register('gsfontderivative', @_); + } else { + return type1($com, @_); + } +} + +sub tt_register_cjk { + my %addstr = ('Japanese' => '-Ja', + 'Korean' => '-Ko', + 'Chinese-China' => '-GB', + 'Chinese-Taiwan' => '-CNS'); + my %ordering = ('Japanese' => 'Japan1', + 'Korean' => 'Korea1', + 'Chinese-China' => 'GB1', + 'Chinese-Taiwan' => 'CNS1'); + my %coding = ('Unicode' => 'Unicode', + 'BIG5' => 'Big5', + 'ShiftJIS' => 'ShiftJIS', + 'WanSung' => 'WanSung', + 'Johab' => 'Johab'); + + my $cnt = shift; + my $loc = shift; + my $font = shift; + my $fontname = shift; + my $alias = shift; + my $charset = shift; + my $encoding = shift; + my $priority = shift; + + return $cnt unless (exists($addstr{$loc}) && exists($ordering{$loc}) && + exists($coding{$encoding})); + my $ord = $ordering{$loc}; + my $enc = $coding{$encoding}; + + my $add = ''; + $add = $addstr{$loc} if ($cnt > 0); + + my @hints = ('Adobe', $ord, $enc, + '--CIDRegistry', 'Adobe', '--CIDOrdering', $ord); + + defoma_id_register($Id, type => 'real', font => $font, + id => $fontname . $add, priority => $priority, + category => 'truetype-cjk', + hints => join(' ', @hints, @_)); + + foreach my $i (@{$alias}) { + defoma_id_register($Id, type => 'alias', font => $font, + id => $i . $add, priority => $priority, + category => 'truetype-cjk', + origin => $fontname . $add); + } + + defoma_subst_register($Sb1, $font, $fontname . $add); + defoma_subst_register($Sb2, $font, $fontname . $add); + + $cnt++; + return $cnt unless ($charset =~ /JISX0212/ && $loc eq 'Japanese' && + $encoding eq 'Unicode'); + + $add = '-JaH'; + @hints = ('Adobe', 'Japan2', 'Unicode', + '--CIDRegistry', 'Adobe', '--CIDOrdering', 'Japan2'); + + defoma_id_register($Id, type => 'real', font => $font, + id => $fontname . $add, priority => $priority, + category => 'truetype-cjk', + hints => join(' ', @hints, @_)); + + foreach my $i (@{$alias}) { + defoma_id_register($Id, type => 'alias', font => $font, + id => $i . $add, priority => $priority, + category => 'truetype-cjk', + origin => $fontname . $add); + } + + defoma_subst_register($Sb1, $font, $fontname . $add); + defoma_subst_register($Sb2, $font, $fontname . $add); + + $cnt++; + return $cnt; +} + +sub tt_register { + my $font = shift; + my $h = parse_hints_start(@_); + my $i; + + my $fontname = $h->{FontName}; + my $location = $h->{Location}; + my $encoding = $h->{Encoding}; + my $priority = $h->{Priority} || 0; + my $charset = $h->{Charset}; + + return 1 unless ($fontname && $location && $encoding); + $fontname =~ s/ .*//; + my @alias = ($h->{Alias}) ? split(/ +/, $h->{Alias}) : (); + + return 2 if (create_symlink($font)); + + parse_hints_cut($h, 'Encoding', 'Location', 'FontName'); + my @hints; + + if ($location !~ /Japanese|Korean|Chinese/) { + @hints = parse_hints_build($h); + + defoma_id_register($Id, type => 'real', font => $font, id => $fontname, + priority => $priority, hints => join(' ', @hints)); + + foreach $i (@alias) { + defoma_id_register($Id, type => 'alias', font => $font, id => $i, + priority => $priority, origin => $fontname); + } + + defoma_subst_register($Sb1, $font, $fontname); + defoma_subst_register($Sb2, $font, $fontname); + } else { + parse_hints_cut($h, 'Charset'); + @hints = parse_hints_build($h); + + my $loc; + my @locs = split(/ /, $location); + my $cnt = 0; + + foreach $loc (@locs) { + $cnt = tt_register_cjk($cnt, $loc, $font, $fontname, \@alias, + $charset, $encoding, $priority, @hints); + } + } + + return 0; +} + +sub tt_unregister { + my $font = shift; + + defoma_subst_unregister($Sb1, $font); + defoma_subst_unregister($Sb2, $font); + defoma_id_unregister($Id, type => 'alias', font => $font); + defoma_id_unregister($Id, type => 'real', font => $font); + + remove_symlink($font); + + return 0; +} + +sub tt_install { + my $type = shift; + my $font = shift; + my $id = shift; + my $depfont = shift; + my $depid = shift; + + my @add = (); + + $add[0] = '--RealName' if ($type eq 'real'); + + register_ps($id, @_, @add); + + return 0; +} + +sub tt_remove { + my $type = shift; + my $font = shift; + my $id = shift; + my $depfont = shift; + my $depid = shift; + + unregister_ps($id); + + return 0; +} + +sub truetype { + my $com = shift; + + if ($com eq 'register') { + return tt_register(@_); + } elsif ($com eq 'unregister') { + return tt_unregister(@_); + } elsif ($com =~ /^do-install-(.*)$/) { + return tt_install($1, @_); + } elsif ($com =~ /^do-remove-(.*)$/) { + return tt_remove($1, @_); + } elsif ($com eq 'init') { + return init(); + } elsif ($com eq 'term') { + return term(); + } + + return 0; +} + +sub truetype_cjk { + my $com = shift; + + if ($com =~ /^do-install-(.*)$/) { + return cid_install($1, @_); + } elsif ($com =~ /^do-remove-(.*)$/) { + return cid_remove($1, @_); + } elsif ($com eq 'init') { + return init(); + } elsif ($com eq 'term') { + return term(); + } + + return 0; +} + +sub cid_register { + my $type = shift; + my $font = shift; + my $h = parse_hints_start(@_); + + my $fontname = $h->{FontName}; + my $registry = $h->{CIDRegistry}; + my $ordering = $h->{CIDOrdering}; + my $priority = $h->{Priority} || 0; + + return 1 unless($fontname && $registry && $ordering); + $fontname =~ s/ .*//; + $registry =~ s/ .*//; + $ordering =~ s/ .*//; + my @alias = ($h->{Alias}) ? split(/ +/, $h->{Alias}) : (); + + return 2 if (create_symlink($font)); + + parse_hints_cut($h, 'PSCharset', 'PSEncoding', 'Charset', 'Encoding'); + my @hints = parse_hints_build($h); + @hints = ($registry, $ordering, '.', @hints); + + defoma_id_register($Id, type => 'real', font => $font, + id => $fontname, priority => $priority, + category => $type, hints => join(' ', @hints)); + + my $i; + foreach $i (@alias) { + defoma_id_register($Id, type => 'alias', font => $font, id => $i, + priority => $priority, origin => $fontname, + category => $type); + } + + defoma_subst_register($Sb1, $font, $fontname); + defoma_subst_register($Sb2, $font, $fontname); + + return 0; +} + +sub cid_unregister { + my $font = shift; + + defoma_subst_unregister($Sb1, $font); + defoma_subst_unregister($Sb2, $font); + defoma_id_unregister($Id, type => 'alias', font => $font); + defoma_id_unregister($Id, type => 'real', font => $font); + + remove_symlink($font); + + return 0; +} + +sub cid_install_all { + my $type = shift; + my $id = shift; + my $registry = shift; + my $ordering = shift; + + my @cmaps = defoma_id_get_font($IdCmap, 'installed'); + foreach my $c (@cmaps) { + my @chs = split(/ +/, $IdCmap->{7}->[$c]); + + next if ($chs[0] ne $registry); + next if ($chs[1] ne $ordering && $chs[1] ne 'Identity'); + + shift(@chs); + shift(@chs); + + my $psname = $id . '-' . $IdCmap->{0}->[$c]; + + my @add = (); + $add[0] = '--RealName' if ($type eq 'real'); + + register_ps($psname, @_, @add, @chs); + } + + return 0; +} + +sub cid_remove_all { + my $type = shift; + my $id = shift; + my $registry = shift; + my $ordering = shift; + + my @cmaps = defoma_id_get_font($IdCmap, 'installed'); + foreach my $c (@cmaps) { + my @chs = split(/ +/, $IdCmap->{7}->[$c]); + + next if ($chs[0] ne $registry); + next if ($chs[1] ne $ordering && $chs[1] ne 'Identity'); + + my $psname = $id . '-' . $IdCmap->{0}->[$c]; + + unregister_ps($psname); + } + + return 0; +} + +sub cid_install { + my $type = shift; + my $font = shift; + my $id = shift; + my $depfont = shift; + my $depid = shift; + my $registry = shift; + my $ordering = shift; + my $encoding = shift; + + cid_install_all($type, $id, $registry, $ordering, @_); + + return 0; +} + +sub cid_remove { + my $type = shift; + my $font = shift; + my $id = shift; + my $depfont = shift; + my $depid = shift; + my $registry = shift; + my $ordering = shift; + my $encoding = shift; + + cid_remove_all($type, $id, $registry, $ordering); + + return 0; +} + +sub cid { + my $com = shift; + + if ($com eq 'register') { + return cid_register('cid', @_); + } elsif ($com eq 'unregister') { + return cid_unregister(@_); + } elsif ($com =~ /^do-install-(.*)$/) { + return cid_install($1, @_); + } elsif ($com =~ /^do-remove-(.*)$/) { + return cid_remove($1, @_); + } elsif ($com eq 'init') { + return init(); + } elsif ($com eq 'term') { + return term(); + } + + return 0; +} + +sub cmap_register { + my $font = shift; + + if ($font =~ /\/gs-cjk-resource\//) { + return 2 if (create_symlink($font, $CMapDir)); + return 0; + } + + my $h = parse_hints_start(@_); + + my $cmap = $h->{CMapName}; + my $reg = $h->{CIDRegistry}; + my $ord = $h->{CIDOrdering}; + + return 1 unless ($cmap && $reg && $ord); + $reg =~ s/ .*//; + $ord =~ s/ .*//; + $cmap =~ s/ .*//; + + my @hints = ($reg, $ord, @_); + + defoma_id_register($IdCmap, type => 'real', font => $font, id => $cmap, + priority => 0, hints => join(' ', @hints)); + + return 0; +} + +sub cmap_unregister { + my $font = shift; + + if ($font =~ /\/gs-cjk-resource\//) { + remove_symlink($font, $CMapDir); + return 0; + } + + defoma_id_unregister($IdCmap, type => 'real', font => $font); + + return 0; +} + +sub cmap_install { + my $font = shift; + my $cmap = shift; + my $df = shift; + my $di = shift; + my $reg = shift; + my $ord = shift; + my %hash; + my @nonreal = (); + + return 1 if (create_symlink($font, $CMapDir)); + + my @list = (defoma_id_get_font($Id, 'installed', f4 => 'cid'), + defoma_id_get_font($Id, 'installed', f4 => 'truetype-cjk')); + + foreach my $i (@list) { + my $type = $Id->{2}->[$i]; + my $id = $Id->{0}->[$i]; + + if ($type ne 'SrI') { + push(@nonreal, $i); + next; + } + + my @hints = split(/ +/, $Id->{7}->[$i]); + + next if ($hints[0] ne $reg); + next if ($hints[1] ne $ord && $ord ne 'Identity'); + + $hash{$id} = $i; + + shift(@hints); + shift(@hints); + shift(@hints); + + my $psname = $id . '-' . $cmap; + + register_ps($psname, @hints, '--RealName', @_); + } + + foreach my $i (@nonreal) { + my $depid = $Id->{5}->[$i]; + next unless (exists($hash{$depid})); + + my @hints = split(/ +/, $Id->{7}->[$hash{$depid}]); + + next if ($hints[0] ne $reg); + next if ($hints[1] ne $ord && $ord ne 'Identity'); + + shift(@hints); + shift(@hints); + shift(@hints); + + my $psname = $Id->{0}->[$i] . '-' . $cmap; + + register_ps($psname, @hints, @_); + } + + return 0; +} + +sub cmap_remove { + my $font = shift; + my $cmap = shift; + my $df = shift; + my $di = shift; + my $reg = shift; + my $ord = shift; + my %hash; + + remove_symlink($font, $CMapDir); + + my @list = (defoma_id_get_font($Id, 'installed', f4 => 'cid'), + defoma_id_get_font($Id, 'installed', f4 => 'truetype-cjk')); + + foreach my $i (@list) { + my @hints = split(/ +/, $Id->{7}->[$i]); + + if (@hints > 0) { + next if ($hints[0] ne $reg); + next if ($hints[1] ne $ord && $ord ne 'Identity'); + } + + my $psname = $Id->{0}->[$i] . '-' . $cmap; + + unregister_ps($psname); + } + + return 0; +} + +sub cmap { + my $com = shift; + + if ($com eq 'register') { + return cmap_register(@_); + } elsif ($com eq 'unregister') { + return cmap_unregister(@_); + } elsif ($com eq 'do-install-real') { + return cmap_install(@_); + } elsif ($com eq 'do-remove-real') { + return cmap_remove(@_); + } elsif ($com eq 'init') { + return init(); + } elsif ($com eq 'term') { + return term(); + } + + return 0; +} + +sub psprint_register { + my $font = shift; + return 0 unless ($Subst4psprint); + return 1 if ($font !~ /(.+)\/(.+)/); + + return 0 if ($1 eq ''); + my $fontname = $2; + + return 2 if ($Sb1->grep_rule('', $fontname)); + + my @hints; + my $h = parse_hints_start(@_); + my $cset = $h->{PSCharset}; + my $enc = $h->{PSEncoding}; + + if ($cset && $enc && $cset =~ /^Adobe-([^-]+).*$/) { + my $ord = $1; + $fontname =~ s/-$enc$//; + + parse_hints_cut($h, 'PSCharset', 'PSEncoding', 'Charset', 'Encoding', + 'Direction'); + @hints = parse_hints_build($h); + push(@hints, '--CIDRegistry,*', 'Adobe', '--CIDOrdering,*', $ord); + } else { + @hints = @_; + } + + for my $i (@hints) { + $i = '--Charset,*' if ($i eq '--Charset'); + $i = '--Encoding,*' if ($i eq '--Encoding'); + $i = '--Direction,*' if ($i eq '--Direction'); + $i = '--Shape,2' if ($i eq '--Shape'); + } + + defoma_subst_add_rule($Sb1, $fontname, @hints); + + return 0; +} + +sub psprint_unregister { + my $font = shift; + return 0 if ($font !~ /(.+)\/(.+)/); + + return 0 if ($1 eq ''); + my $fontname = $2; + + my $h = parse_hints_start(@_); + my $cset = $h->{PSCharset}; + my $enc = $h->{PSEncoding}; + + if ($cset && $enc && $cset =~ /^Adobe-.*$/) { + $fontname =~ s/-$enc$//; + } + + defoma_subst_remove_rule($Sb1, $fontname); + + return 0; +} + +sub psprint { + my $com = shift; + + if ($com eq 'register') { + return psprint_register(@_); + } elsif ($com eq 'unregister') { + return psprint_unregister(@_); + } elsif ($com eq 'init') { + return init(); + } elsif ($com eq 'term') { + return term(); + } + + return 0; +} + +1; --- ghostscript-8.71.dfsg.1.orig/debian/control +++ ghostscript-8.71.dfsg.1/debian/control @@ -0,0 +1,162 @@ +Source: ghostscript +Section: text +Priority: optional +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Masayuki Hatta (mhatta) +Build-Depends: autoconf, automake1.9 | automaken, debhelper (>= 4.1.0), dpatch, freeglut3-dev | libglut-dev, libjpeg-dev, libpaper-dev, libpng-dev, libtiff-dev, libz-dev, libxt-dev, libxext-dev, libx11-dev, libcups2-dev (>= 1.3.7), libcupsimage2-dev (>= 1.1.20final+rc1-4), libice-dev, libsm-dev, pkg-config, libfontconfig1-dev, cdbs +Standards-Version: 3.8.0 +Uploaders: Torsten Landschoff , Jonas Smedegaard +Homepage: http://www.ghostscript.com/ +Vcs-Svn: svn://svn.debian.org/svn/pkg-gs/ghostscript/trunk/ +Vcs-Browser: http://svn.debian.org/wsvn/pkg-gs/ghostscript/trunk/ + +Package: ghostscript +Architecture: any +Conflicts: gs (<< 8.63), gs-esp (<< 8.63), gs-gpl (<< 8.63), gs-afpl (<< 8.63), gs-aladdin (<< 8.63), gs-cjk-resource (<< 1.20010910-1), gs-pdfencrypt (<< 7.00), gs-common (<< 8.63), ghostscript-fonts +Replaces: gs (<< 8.63), gs-esp (<< 8.63), gs-gpl (<< 8.63), gs-afpl (<< 8.63), gs-aladdin (<< 8.63), gs-pdfencrypt (<< 7.00), gs-common (<< 8.63), ghostscript-fonts +Provides: gs-pdfencrypt, postscript-viewer, gs-common +Recommends: psfontmgr +Suggests: ghostscript-cups, ghostscript-x, hpijs +Depends: ${shlibs:Depends}, gsfonts (>= 6.0-1), defoma, debconf | debconf-2.0, debianutils (>= 1.6), libgs8 (= ${binary:Version}), ${misc:Depends} +Description: The GPL Ghostscript PostScript/PDF interpreter + Ghostscript is used for PostScript/PDF preview and printing. Usually as + a back-end to a program such as ghostview, it can display PostScript and PDF + documents in an X11 environment. + . + Furthermore, it can render PostScript and PDF files as graphics to be printed + on non-PostScript printers. Supported printers include common + dot-matrix, inkjet and laser models. + . + Package gsfonts contains a set of standard fonts for Ghostscript. + +Package: gs +Architecture: all +Priority: extra +Depends: ghostscript, ghostscript-x, ${misc:Depends} +Description: Transitional package + This dummy package is provided for a smooth transition from the + previous gs package (the package name has been changed to ghostscript). + It may safely be removed after installation. + +Package: gs-esp +Architecture: all +Priority: extra +Depends: ghostscript, ${misc:Depends} +Description: Transitional package + This dummy package is provided for a smooth transition from the + previous gs-esp package (the package is replaced by ghostscript). + It may safely be removed after installation. + +Package: gs-gpl +Architecture: all +Priority: extra +Depends: ghostscript, ghostscript-x, ${misc:Depends} +Description: Transitional package + This dummy package is provided for a smooth transition from the + previous gs-gpl package (the package is replaced by ghostscript). + It may safely be removed after installation. + +Package: gs-aladdin +Architecture: all +Priority: extra +Depends: ghostscript, ghostscript-x, ${misc:Depends} +Description: Transitional package + This dummy package is provided for a smooth transition from the + previous gs-aladdin package (the package is replaced by ghostscript). + It may safely be removed after installation. + +Package: gs-common +Architecture: all +Priority: extra +Depends: ghostscript, ${misc:Depends} +Description: Dummy package depending on ghostscript + This dummy package is provided for a smooth transition from the + previous gs-.../gs-common combo (the packages are replaced by ghostscript). + It may safely be removed after installation. + +Package: ghostscript-cups +Architecture: any +Depends: ${shlibs:Depends}, ghostscript (>= 8.64.dfsg.1-0ubuntu10), ${misc:Depends}, cups-client, cups +Conflicts: ghostscript (<< 8.64.dfsg.1-0ubuntu10), cups (<< 1.3.9-4) +Description: The GPL Ghostscript PostScript/PDF interpreter - CUPS filters + Ghostscript is used for PostScript/PDF preview and printing. Usually as + a back-end to a program such as ghostview, it can display PostScript and PDF + documents in an X11 environment. + . + This package contains the CUPS filters, drivers, and PPDs which come with + Ghostscript. To not make Ghostscript itself requiring CUPS these files are + in a separate package now. + +Package: ghostscript-x +Architecture: any +Depends: ${shlibs:Depends}, ghostscript (>= 8.63), ${misc:Depends} +Conflicts: ghostscript (<< 8.63) +Provides: gs, gs-esp, gs-gpl, gs-afpl, gs-aladdin +Description: The GPL Ghostscript PostScript/PDF interpreter - X Display support + Ghostscript is used for PostScript/PDF preview and printing. Usually as + a back-end to a program such as ghostview, it can display PostScript and PDF + documents in an X11 environment. + . + This package contains the Ghostscript output device for X11. It is in + a separate package to allow the main package (ghostscript) to be installed + on X-less servers. + +Package: gs-esp-x +Architecture: all +Priority: extra +Depends: ghostscript-x +Description: Transitional package + This dummy package is provided for a smooth transition from the + previous gs-esp-x package (the package is replaced by ghostscript-x). + It may safely be removed after installation. + +Package: ghostscript-doc +Section: doc +Architecture: all +Depends: ${shlibs:Depends}, ghostscript (>= 8.63), ${misc:Depends} +Conflicts: ghostscript (<< 8.63) +Description: The GPL Ghostscript PostScript/PDF interpreter - Documentation + Ghostscript is used for PostScript/PDF preview and printing. Usually as + a back-end to a program such as ghostview, it can display PostScript and PDF + documents in an X11 environment. + . + This package contains the documentation of Ghostscript. As this documentation + is only interesting for printer driver developers or advanced users, it is + in this separate package which can be left out in space-restricted + installations, like for example live CDs. + +Package: libgs8 +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: The Ghostscript PostScript/PDF interpreter Library + Ghostscript is used for PostScript/PDF preview and printing. Usually as + a back-end to a program such as ghostview, it can display PostScript and PDF + documents in an X11 environment. + . + This package provides the Ghostscript library which makes the + facilities of Ghostscript available to applications. + +Package: libgs-dev +Section: libdevel +Architecture: any +Depends: ${shlibs:Depends}, libgs8 (= ${binary:Version}), ${misc:Depends} +Conflicts: libgs-esp-dev (<< 8.63) +Replaces: libgs-esp-dev (<< 8.63) +Provides: libgs-esp-dev +Description: The Ghostscript PostScript Library - Development Files + Ghostscript is used for PostScript/PDF preview and printing. Usually as + a back-end to a program such as ghostview, it can display PostScript and PDF + documents in an X11 environment. + . + This package provides the development files for the Ghostscript library + which makes the facilities of Ghostscript available to applications. + +Package: libgs-esp-dev +Architecture: all +Priority: extra +Depends: libgs-dev +Description: Transitional package + This dummy package is provided for a smooth transition from the + previous libgs-esp-dev package (the package is replaced by libgs-dev). + It may safely be removed after installation. --- ghostscript-8.71.dfsg.1.orig/debian/ghostscript.postinst +++ ghostscript-8.71.dfsg.1/debian/ghostscript.postinst @@ -0,0 +1,54 @@ +#! /bin/sh +# postinst script for ghostscript +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package +# + +case "$1" in + configure) + # /usr/bin/ps2pdf is now controlled by update-alternatives + update-alternatives --install /usr/bin/ps2pdf \ + ps2pdf /usr/bin/ps2pdf14 50 + update-alternatives --install /usr/bin/ps2pdf \ + ps2pdf /usr/bin/ps2pdf12 30 + update-alternatives --install /usr/bin/ps2pdf \ + ps2pdf /usr/bin/ps2pdf13 40 + + # Make sure the substitution file for Ghostscript exists + if ! defoma-subst check-rule ghostscript; then + defoma-subst new-rule ghostscript + fi + + defoma-app -t update gs + + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 --- ghostscript-8.71.dfsg.1.orig/debian/ghostscript.preinst +++ ghostscript-8.71.dfsg.1/debian/ghostscript.preinst @@ -0,0 +1,45 @@ +#!/bin/sh +# preinst script for ghostscript +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) + # Do away with update-alternative for /usr/bin/gs, we have one + # grand unified Ghostscript now! + if dpkg --compare-versions "$2" lt-nl "8.63.dfsg.1-1"; then + update-alternatives --remove-all gs || true + update-alternatives --remove-all gs.1 || true + fi + + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- ghostscript-8.71.dfsg.1.orig/debian/changelog +++ ghostscript-8.71.dfsg.1/debian/changelog @@ -0,0 +1,2100 @@ +ghostscript (8.71.dfsg.1-0ubuntu5.6) lucid-security; urgency=medium + + * SECURITY UPDATE: heap overflows via crafted jp2 file + - debian/patches/CVE-2014-9029.dpatch: fix off-by-one in + jasper/src/libjasper/jpc/jpc_dec.c. + - CVE-2014-9029 + + -- Marc Deslauriers Fri, 05 Dec 2014 15:47:32 -0500 + +ghostscript (8.71.dfsg.1-0ubuntu5.5) lucid-security; urgency=low + + * SECURITY UPDATE: denial of service and possible code execution via + icclib overflow + - debian/patches/CVE-2012-4405.dpatch: validate input channels in + icclib/icc.c. + - CVE-2012-4405 + + -- Marc Deslauriers Fri, 21 Sep 2012 08:55:37 -0400 + +ghostscript (8.71.dfsg.1-0ubuntu5.4) lucid-security; urgency=low + + * SECURITY UPDATE: integer overflows via integer multiplication for + memory allocation + - debian/patches/CVE-2008-352x.dpatch: introduce new size-checked + allocation functions and use them in: + * jasper/src/libjasper/base/{jas_cm.c,jas_icc.c,jas_image.c, + jas_malloc.c,jas_seq.c} + * jasper/src/libjasper/bmp/bmp_dec.c + * jasper/src/libjasper/include/jasper/jas_malloc.h + * jasper/src/libjasper/jp2/{jp2_cod.c,jp2_dec.c,jp2_enc.c} + * jasper/src/libjasper/jpc/{jpc_cs.c,jpc_dec.c,jpc_enc.c,jpc_mqdec.c, + jpc_mqenc.c,jpc_qmfb.c,jpc_t1enc.c,jpc_t2cod.c,jpc_t2dec.c, + jpc_t2enc.c,jpc_tagtree.c,jpc_util.c} + * jasper/src/libjasper/mif/mif_cod.c + - CVE-2008-3520 + * SECURITY UPDATE: buffer overflow via vsprintf in jas_stream_printf() + - debian/patches/CVE-2008-352x.dpatch: use vsnprintf() in + jasper/src/libjasper/base/jas_stream.c + - CVE-2008-3522 + * SECURITY UPDATE: denial of service and possible code execution via + heap-based buffer overflows. + - debian/patches/CVE-2011-451x.dpatch: validate compparms->numrlvls + and allocate proper size in jasper/src/libjasper/jpc/jpc_cs.c. + - CVE-2011-4516 + - CVE-2011-4517 + + -- Marc Deslauriers Tue, 20 Dec 2011 15:44:19 -0500 + +ghostscript (8.71.dfsg.1-0ubuntu5.3) lucid-proposed; urgency=low + + * debian/patches/ps2pdf-hyperlinks.dpatch: Let ps2pdf create proper hyperlinks + (LP: #583990, upstream bug #691344). + + -- Till Kamppeter Mon, 19 Jul 2010 19:15:20 +0200 + +ghostscript (8.71.dfsg.1-0ubuntu5.2) lucid-security; urgency=low + + * SECURITY UPDATE: arbitrary code execution via unlimited recursive + procedure invocations (LP: #546009) + - debian/patches/CVE-2010-1628.dpatch: only initialize structures if + all allocations were successful in psi/ialloc.c, psi/idosave.h, + psi/isave.c. + - CVE-2010-1628 + + -- Marc Deslauriers Fri, 09 Jul 2010 08:06:19 -0400 + +ghostscript (8.71.dfsg.1-0ubuntu5.1) lucid-proposed; urgency=low + + * debian/patches/pdf-interpreter-segfault-fixes.dpatch, + debian/patches/cups-raster-fixes.dpatch, + debian/patches/fapi-buildchar-object-null-check.dpatch, + debian/patches/cups-raster-error-out-without-segfault-and-force-banding.dpatch, + debian/patches/cups-raster-fix-memory-reallocation.dpatch: Fixed several + problems in the PDF interpreter and the CUPS Raster output device of + Ghostscript to avoid Ghostscript erroring out or even crashing on many + input files when printing with a CUPS Raster driver (LP: 539708, upstream + bug #691014). Joined all changes on cups/gdevcups.c into one patch as + the patches are overlapping and parts of the old patches are undone. + + -- Till Kamppeter Thu, 29 Apr 2010 09:43:23 +0200 + +ghostscript (8.71.dfsg.1-0ubuntu5) lucid; urgency=low + + * debian/patches/pdf2dsc-fix-for-pdflatex-preview.dpatch: + Fix pdflatex preview mode using the patch from http://svn.ghostscript.com/viewvc?view=rev&revision=10778 + by William Bader (LP: #543266) + + -- Josh Holland Fri, 02 Apr 2010 08:25:31 +0100 + +ghostscript (8.71.dfsg.1-0ubuntu4) lucid; urgency=low + + * debian/patches/cups-raster-error-out-without-segfault-and-force-banding.dpatch: + Make the "cups" output device (CUPS Raster) error out correctly without + causing segfaults and also force banding mode as some PDFs do not render + otherwise (LP: #534525). + + -- Till Kamppeter Tue, 23 Mar 2010 10:22:23 +0100 + +ghostscript (8.71.dfsg.1-0ubuntu3) lucid; urgency=low + + * debian/patches/pdftoraster-wait-for-ghostscript.dpatch: pdftoraster exited + already before its Ghostscript subprocess finished. Thanks to Tim Waugh + from Red Hat for the fix. + * debian/patches/cups-raster-fix-memory-reallocation.dpatch: Fixed bug + in memory reallocation on bitmap size changes. Color depth was not + taken into account. This caused black pages to be printed with some + CUPS Raster drivers, like Turboprint. Fixes upstream bugs #691029 and + #691108. + * debian/patches/fix-broken-korean-example.dpatch: Fixed example file for + rendering Korean text. + + -- Till Kamppeter Tue, 9 Mar 2010 17:56:23 +0100 + +ghostscript (8.71.dfsg.1-0ubuntu2) lucid; urgency=low + + * no-cant-refill-scanner-input-buffer-error.dpatch: Ghostscript errored out + when getting fed with the Ubuntu test page + (/usr/share/system-config-printer/testpage-a4.ps) on stdin giving a + "Can't refill scanner input buffer" error. (Upstream bugs #691137, + #690909). + + -- Till Kamppeter Wed, 24 Feb 2010 10:08:23 +0100 + +ghostscript (8.71.dfsg.1-0ubuntu1) lucid; urgency=low + + * New upstream release + o libtiff-based tiff file output + o New "tiffsep1" output device produces halftoned separations at 1 bit + per pixel + o Improved FreeType-based font rasterizing (not yet used as default) + o Improved graphics library for vector graphics conversions + o Many bug fixes on the PCL-XL printer drivers ("pxlmono", "pxlcolor") + o Fixes on back side handling for duplex printing in the CUPS Raster + output device ("cups"). + * debian/patches/gs-cups-rgb-gamma.dpatch, + debian/patches/cljet5-mediasize-fix.dpatch, + debian/patches/pxl-driver-fixes.dpatch, + debian/patches/gs-cups-fix-backside-on-duplex-jobs.dpatch: Removed patches + backported from upstream. + * debian/patches/fix-build-of-executables.dpatch: Fix build of the "gs" + executable, it was built as a shared library and not as an executable. + This lead to an immediate segfault even before "main()" got called. + Thanks to Robin Watts from Ghostscript for the quick fix. + * debian/control: Added build dependency on libtiff-dev. + * debian/ghostscript.links: s/8.70/8.71/ + + -- Till Kamppeter Thu, 11 Feb 2010 11:31:23 +0100 + +ghostscript (8.70.dfsg.1-0ubuntu5) lucid; urgency=low + + * debian/patches/gs-cups-fix-backside-on-duplex-jobs.dpatch: The "cups" + output device (generating input for the CUPS Raster drivers) did not + update the margins and page orientation for the back sides in time and + so the back side was often the wrong way around, especially with printers + which print the back sides backwards, like HP inkjets. The problem occurs + only with PostScript as input and not with PDF, which made the bug not + showing in Ubuntu and Debian. This change is applied to Ubuntu's + Ghostscript so that Lucid users regression-test it before Ghostscript + 8.71 gets released in February (HPLIP upstream bug: LP: #484928). + + -- Till Kamppeter Tue, 26 Jan 2010 15:25:23 +0100 + +ghostscript (8.70.dfsg.1-0ubuntu4) lucid; urgency=low + + * debian/patches/pxl-driver-fixes.dpatch: Several upstream bug fixes + on the PCL-XL drivers ("pxlcolor"/"pxlmono") in Ghostscript, especially + also for PDF input. Thanks to Hin-Tak Leung on putting all that work + into this driver which stayed nearly untouched for around 10 years. + (LP: #361772). + + -- Till Kamppeter Mon, 7 Dec 2009 20:23:23 +0100 + +ghostscript (8.70.dfsg.1-0ubuntu3) karmic; urgency=low + + * debian/patches/cljet5-mediasize-fix.dpatch: Upstream fix for the media + size handling of the "cljet5" printer driver. + + -- Till Kamppeter Mon, 12 oct 2009 15:47:23 +0200 + +ghostscript (8.70.dfsg.1-0ubuntu2) karmic; urgency=low + + * debian/ghostscript-cups.postinst: Fixed "lpstat -r" check for the + auto update of PPDs of existing queues. "lpstat -r" exits always with + status 0, we must check the actual output. Call lpstat, lpadmin, and + cupsctl with "-h /var/run/cups/cups.sock" to avoid querying remote + servers set up in /etc/cups/client.conf, and asking for passwords. + Thanks to Martin-Éric Racine for tracking this down and the solution! + See Debian bug #543468. Use signal names instead of numbers for trap. + Quiesces a lintian bashism warning. + * debian/rules: Remove /usr/bin/ps2pdf from the ghostscript package, it was + treated by update-alternatives for a longer time already (LP: #429856). + + -- Till Kamppeter Fri, 18 Sep 2009 15:37:23 +0200 + +ghostscript (8.70.dfsg.1-0ubuntu1) karmic; urgency=low + + * New upstream release + o License is now GPLv3 or later + o No functional change. This is only to let the final release not + appear as a release candidate in the help output and documentation + and also to reflect the new license. + * debian/copyright: License change. + + -- Till Kamppeter Sat, 01 Aug 2009 19:04:40 +0200 + +ghostscript (8.70.dfsg.1~rc1-0ubuntu1) karmic; urgency=low + + * New upstream release + o Fixes many transparency problems: color space conversion, mask contexts, + patterns, ... + o Fixes in font handling, especially when generating PDF + o Improvements in robustness, correctness, and performance + o New generic Esc/Page drivers: "eplmono", "eplcolor" + o New "cdnj500" driver for many HP DesignJet printers + o License is now GPLv2 or later and not GPLv2-only any more + o Merged all patches of the Ubuntu and Debian packages upstream + o Fixes LP: #196009 + * debian/patches/33_bad-params-to-xinitimage-on-large-bitmaps.dpatch, + debian/patches/35_bitcmyk-blank-output.dpatch, + debian/patches/37_fix-segfault-in-cups-raster-output-device.dpatch, + debian/patches/38_CVE-2009-0583_0584.dpatch, + debian/patches/40_pdfwrite-numcopies.dpatch, + debian/patches/41_CVE-2009-0196.dpatch, + debian/patches/42_CVE-2009-0792.dpatch, + debian/patches/43_add-cdnj500-driver.dpatch, + debian/patches/45_cups-device-pagesize-margins-duplex-fixes.dpatch, + debian/patches/47_ps2write-segfault-fix.dpatch, + debian/patches/50_ps2write-do-not-advertize-dsc-conformance.dpatch, + debian/patches/53_fix-pstoraster-for-call-with-input-filename.dpatch: + Removed patches backported from upstream. + * debian/copyright: License change. + * debian/ghostscript.links: s/8.64/8.70/ + + -- Till Kamppeter Wed, 29 Jul 2009 09:47:54 +0200 + +ghostscript (8.64.dfsg.1-0ubuntu15) karmic; urgency=low + + * debian/patches/43_add-cdnj500-driver.dpatch: Set rendering intent for + the "Presentation" quality in the "cdnj500" driver to "Perceptual", this + gives better colors than the original "SATURATION". + + -- Till Kamppeter Mon, 13 Jul 2009 14:22:49 +0200 + +ghostscript (8.64.dfsg.1-0ubuntu14) karmic; urgency=low + + * debian/control: Moved dependencies of ghostscript-cups on cups, + cups-client back to Depends:, for post-install this is sufficient. + + -- Till Kamppeter Tue, 2 Jun 2009 09:43:49 +0200 + +ghostscript (8.64.dfsg.1-0ubuntu13) karmic; urgency=low + + * debian/control: Moved dependencies of ghostscript-cups on cups, + cups-client, and perl-base to Pre-Depends:, as only this way it is + assured that these packages are configured (especially CUPS daemon + running) before this package gets configured (update of the PPDs of + existing queues). + + -- Till Kamppeter Mon, 1 Jun 2009 20:35:49 +0200 + +ghostscript (8.64.dfsg.1-0ubuntu12) karmic; urgency=low + + * debian/control: Removed unneeded "perl" from Depends:. This is only + needed for Perl applications, not for a simple "perl -p -e ..." in the + postinst script. + + -- Till Kamppeter Tue, 26 May 2009 16:53:49 +0200 + +ghostscript (8.64.dfsg.1-0ubuntu11) karmic; urgency=low + + * debian/patches/53_fix-pstoraster-for-call-with-input-filename.dpatch: + pstoraster did not work when called with an input file name as the 6th + command line argument. + + * debian/patches/50_ps2write-do-not-advertize-dsc-conformance.dpatch: + The "ps2write" output device produces PostScript which is not + DSC-conforming, so do not advertize it as DSC-conforming with a + "%!PS-Adobe-..." magic string. Use "%!" instead. Otherwise the "pstops" + CUPS filter cannot handle this output (LP: #377011). + + * debian/patches/45_cups-device-pagesize-margins-duplex-fixes.dpatch: + Fixed recognition of page size via /cupsPageSizeName. All page sizes were + considered custom sizes if /cupsPageSizeName was not set. + + -- Till Kamppeter Thu, 21 May 2009 15:25:49 +0200 + +ghostscript (8.64.dfsg.1-0ubuntu10) karmic; urgency=low + + * debian/control, debian/rules, debian/ghostscript.postinst, + debian/ghostscript-cups.postinst: Splitted off the CUPS-related files + into its own package, so that the requirements of cups and cups-client + for the automatic update of the PPDs of existing print queues do not + apply to the ghostscript core package. Added cups and cups-client to + the Depnds: entry of the new ghostscript-cups, so that the automatic + updates of the PPDs also works on updates to a new release of the + distribution and not only on single-package updates. Added also perl + as dependency to the ghostscript-cups package as it is also needed + for the automatic PPD updates. + + -- Till Kamppeter Mon, 18 May 2009 23:19:49 +0200 + +ghostscript (8.64.dfsg.1-0ubuntu9) karmic; urgency=low + + * debian/patches/47_ps2write-segfault-fix.dpatch: The "ps2write" output + device segfaults on the testfile.pdf of the CUPS test suite, making + CUPS FTBFS if "ps2write" is used by one of the CUPS filters (Upstream + bug #690475). + + * debian/patches/45_cups-device-pagesize-margins-duplex-fixes.dpatch: + The CUPS Raster output device did not handle the unprintable margins + correctly on landscape-oriented pages and on back sides. Added also + support for the PPD keywords "*cupsBackSide:" and + "*APDuplexRequiresFlippedMargin:". + + * debian/patches/43_add-cdnj500-driver.dpatch: Added driver "cdnj500" for + HP DesignJet 500 and 800. + + -- Till Kamppeter Tue, 12 May 2009 15:49:49 +0200 + +ghostscript (8.64.dfsg.1-0ubuntu8) jaunty; urgency=low + + * SECURITY UPDATE: possible arbitrary code execution via JBIG2 symbol + dictionary segments + - debian/patches/41_CVE-2009-0196.dpatch: validate size of runlength + in export symbol table in jbig2dec/jbig2_symbol_dict.c. + - CVE-2009-0196 + * SECURITY UPDATE: denial of service and possible arbitrary code + execution via integer overflows in icclib + - debian/patches/42_CVE-2009-0792.dpatch: fix numerous overflows in + icclib/icc.c. + - CVE-2009-0792 + + -- Marc Deslauriers Thu, 09 Apr 2009 09:27:31 -0400 + +ghostscript (8.64.dfsg.1-0ubuntu7) jaunty; urgency=low + + * debian/patches/40_pdfwrite-numcopies.dpatch: PDF output device of + Ghostscript did not take into account /#copies or /NumCopies in the + PostScript input, which made some applications, like OpenOffice.org + print only one copy also if more than one copy is requested. No + Ghostscript prints multiple copies with "pdfwrite" if it is called + with "-dDoNumCopies" (LP: #320391, upstream bug #690355). + + -- Till Kamppeter Sun, 5 Apr 2009 22:11:49 +0200 + +ghostscript (8.64.dfsg.1-0ubuntu6) jaunty; urgency=low + + * SECURITY UPDATE: Arbitrary code execution due to integer overflows and + insufficient upper-bounds checks in the ICC library + - debian/patches/38_CVE-2009-0583_0584.dpatch: fix multiple integer + overflows and perform bounds checking in icclib/icc.c. + - CVE-2009-0583 + - CVE-2009-0584 + + -- Marc Deslauriers Fri, 27 Mar 2009 08:51:14 -0400 + +ghostscript (8.64.dfsg.1-0ubuntu5) jaunty; urgency=low + + * debian/patches/00list: Really apply the patch for LP: #333429. + + -- Till Kamppeter Wed, 25 Mar 2009 18:32:49 +0100 + +ghostscript (8.64.dfsg.1-0ubuntu4) jaunty; urgency=low + + * debian/patches/37_fix-segfault-in-cups-raster-output-device.dpatch: + Fixed segfault in the "cups" (CUPS Raster) output device of Ghostscript + (LP: #333429, upstream bug 690338). + + * debian/ghostscript.postinst: Silenced non-fatal error messages when + post-install script updates PPDs and there are PPDs not belonging to + a CUPS queue in /etc/cups/ppd/ (LP: #345866). + + -- Till Kamppeter Wed, 25 Mar 2009 16:13:49 +0100 + +ghostscript (8.64.dfsg.1-0ubuntu3) jaunty; urgency=low + + * debian/local/apport-hook.py, debian/rules: Added apport hook (LP: #338442). + + -- Till Kamppeter Thu, 19 Mar 2009 12:39:49 +0100 + +ghostscript (8.64.dfsg.1-0ubuntu2) jaunty; urgency=low + + * debian/patches/35_bitcmyk-blank-output.dpatch: The bitcmyk output device + produces zero length output (LP: #331127, upstream bug #690287). + + -- Till Kamppeter Wed, 18 Feb 2009 19:52:54 +0100 + +ghostscript (8.64.dfsg.1-0ubuntu1) jaunty; urgency=low + + * New upstream release (Ghostscript 8.64 final release) + o No functional change. This is only to let the final release not + appear as a release candidate in the help output and documentation. + + -- Till Kamppeter Tue, 03 Feb 2009 21:42:54 +0100 + +ghostscript (8.64.dfsg.1~svn9432-0ubuntu1) jaunty; urgency=low + + * New upstream release (SVN rev 9432, RC3) + o Fix regression of X output being broken with large images or other + cases of the image buffer being used (Upstream bug #690222, #690260). + o Fixed the bbox output device for example3.ps in LP: #160203. + + -- Till Kamppeter Mon, 02 Feb 2009 21:42:53 +0100 + +ghostscript (8.64.dfsg.1~svn9415-0ubuntu1) jaunty; urgency=low + + * New upstream release (SVN rev 9415, RC2) + o Fix problem of X display not completely clearing the previous page + before drawing the next page (Upstream bug #690255). + + -- Till Kamppeter Wed, 28 Jan 2009 00:12:16 +0100 + +ghostscript (8.64.dfsg.1~svn9403-0ubuntu1) jaunty; urgency=low + + * New upstream release (SVN rev 9403, RC1) + o Output of PDF-to-PostScript conversion was not DSC-conforming and + prevented CUPS from switching trays when the page size changes in + the middle of the document (LP: #310575) + o All but one Debian patches are incorporated upstream now. + * debian/patches/32_improve-handling-of-media-size-changes-from-gv.dpatch: + Removed, applied upstream. + + -- Till Kamppeter Tue, 27 Jan 2009 10:28:07 +0100 + +ghostscript (8.64.dfsg.1~svn9377-0ubuntu1) jaunty; urgency=low + + * 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/ + + -- Till Kamppeter Tue, 20 Jan 2009 16:40:45 +0100 + +ghostscript (8.63.dfsg.1-2ubuntu2) jaunty; urgency=low + + * debian/rules: Removed /usr/share/ghostscript/8.63/lib/cidfmap, so that + DeFoMa's cidfmap gets used. Otherwise Ubuntu's CJK fonts will not get + found by Ghostscript (Thanks to Koji Otani from BBR Inc., Japan for the + hint). + + -- Till Kamppeter Tue, 6 Jan 2009 09:40:45 +0100 + +ghostscript (8.63.dfsg.1-2ubuntu1) jaunty; urgency=low + + * debian/patches/02_gs_man_fix_debian.dpatch: Corrected paths in the man + page. + * debian/patches/14_gs-cjk_big_cmap_post_table.dpatch, + debian/patches/23_gdevxini_segv_fix.dpatch, + debian/patches/28_print_encrypted_PDFs_from_adobe_reader_8.dpatch: + Removed obsolete patches which were not applied any more for longer time. + * debian/patches/48_cups-output-device-pdf-duplex-uninitialized-memory.patch.dpatch: + Removed accidentally generated file. + * Merge from debian unstable, remaining changes: + - gs-esp and gs-common depend only on ghostscript, not on ghostscript-x, + as gs-esp had already split off gs-esp-x in Ubuntu + - Resource/Font directory left in the .orig.tar.gz, therefore also left + the lines for removing faulty fonts in debian/rules active. + + -- Till Kamppeter Mon, 5 Jan 2009 12:21:45 +0100 + +ghostscript (8.63.dfsg.1-2) unstable; urgency=low + + * libgs-dev: put versioned dependency on libgs8 - closes: #510691 + + -- Masayuki Hatta (mhatta) Sun, 04 Jan 2009 12:09:59 +0900 + +ghostscript (8.63.dfsg.1-1) unstable; urgency=low + + [Masayuki Hatta] + * Maintainer upload, New upstream release. + * Acknowledged NMUs, thanks tv - closes: #472645, #495703, #503712 + * debian/patches/32_improve-handling-of-media-size-changes-from-gv.dpatch: + Allow gv to change the image and media size (Upstream bug #688943) + - closes: #142228 + * debian/patches/33_bad-params-to-xinitimage-on-large-bitmaps.dpatch: + Fixed zooming problem in gv (Upstream bug #689547) + - closes: #419183 + * debian/patches//34_ftbfs-on-hurd-fix.dpatch: + Fixed FTBFS on hurd-i386 - closes: #475704 + * Added Homepage, Vcs-Svn and Vcs-Browser headers in control. + * Sync'd with the Ubuntu 8.63.dfsg.1-0ubuntu13. + + [Till Kamppeter] + * debian/libgs8.shlibs: Removed. All libgs8 versions should have the same + API and ABI. The artificial restriction set by this file required all + reverse dependencies to be rebuilt for every stable release of Ghostscript. + * debian/patches/35_disable_libcairo.dpatch: Added possibility to + compile Ghostscript without the "cairo" output device. The device + is still in experimental state and with its dependency on libcairo + it pulls in a dependency on X. + * debian/control, debian/rules: Build Ghostscript without the "cairo" + output device. + * debian/patches/38_pxl-duplex.dpatch: The Duplex option of the "pxlmono" + and "pxlcolor" drivers did not work. + * debian/patches/39_pxl-resolution.dpatch: The resolution must be also set + as PJL command for the "pxlmono" and "pxlcolor" drivers. + * debian/patches/42_gs-init-ps-delaybind-fix.dpatch: Make "ps2ascii" working + again (Upstream bug #690124) - closes: #81430, #229748, #131528 + * debian/patches/45_bjc600-bjc800-pdf-input.dpatch: Fix setting of the + "DitheringType" option. With PDF input Ghostscript crashes, with + PostScript input the "DitheringType" option was probably ignored + (Upstream bug #690032). + * debian/patches/48_cups-output-device-pdf-duplex-uninitialized-memory.patch.dpatch: + Fixed several bugs in the "cups" (CUPS Raster) output device: + - Ghostscript crashed with PDF input data + - The "Duplex" and "MediaWeight" options were ignored + - There was uninitialized memory and wrong usage of pointers, potential + cause for segmentation faults or even vulnerabilities + - There were mismatches in data types, leading to possible breakage + of the "AdvanceDistance", "MediaWeight", and "cupsStringXX" options. + (Upstream bug #690101). + * debian/local/pdftoraster/pdftoraster.c, + debian/local/pdftoraster/pdftoraster.convs, debian/rules: Added pdftoraster + filter from the Ghostscript SVN repository - closes: #505282 + * debian/patches/50_lips4-floating-point-exception: Fixed floating-point + exception in "lips4" and other drivers (Upstream bug #690122). + * debian/patches/52_cups-device-logging.dpatch: Made logging of the "cups" + output device much less verbose. The log of one jub in debug mode did not + fit into the maximum log file size of CUPS. + * debian/patches/55_pcl-input-slot-fix.dpatch: Made the paper tray selection + via "-dMediaPosition=..." in the PCL 4/5/5e drivers work (Upstream bug + #690182). + * debian/patches/57_pxl-input-slot-fix.dpatch: Made the paper tray selection + via "-dMediaPosition=..." in the PCL 6/XL drivers work. + * debian/patches/60_pxl-cups-driver-pdf.dpatch: Made the PCL-XL CUPS filter + and PPDs work with PDF input. + * debian/patches/62_onebitcmyk-pdf.dpatch: Check the whole Decode array to + detect special cases of identity and inverse decoding in PDF files + (Upstream bug #690178). + * debian/ghostscript.postinst: Added automatic update of the PPD files + of already existing print queues. + * debian/ghostscript.postinst: Do not try to update the PPDs of existing + print queues if CUPS is not installed or not running. + * debian/patches/60_pxl-cups-driver-pdf.dpatch: The pstopxl filter did not + remove its temporary file after finishing. + * debian/patches/65_too-big-temp-files-1.dpatch: Ghostscript produced much + too big temporary files (> 10 GB) when printing photos from GNOME apps in + 1200 dpi. Part 1 of the fix which reduces the temp file size to less than + 2 GB (Upstream bug #690133). + * debian/patches/67_too-big-temp-files-2.dpatch: Complete fix for the too big + temporary files. Now the bug is completely fixed. Temp files are not much + bigger than the jobs themselves now (Upstream bug #690133). + * debian/patches/70_take-into-account-data-in-stream-buffer-before-refill.dpatch: + Certain files lead to a Ghostscript error due to wrong handling of the + stream buffer (Upstream bug #690090). + + -- Masayuki Hatta (mhatta) Sun, 04 Jan 2009 09:30:13 +0900 + +ghostscript (8.63.dfsg.1-0ubuntu13) jaunty; urgency=low + + * debian/patches/70_take-into-account-data-in-stream-buffer-before-refill.dpatch: + Certain files lead to a Ghostscript error due to wrong handling of the + stream buffer (LP: #306125, upstream bug #690090). + + * debian/patches/67_too-big-temp-files-2.dpatch: Complete fix for the too big + temporary files. Now the bug is completely fixed. Temp files are not much + bigger than the jobs themselves now (LP: #288570, upstream bug #690133). + + -- Till Kamppeter Sun, 14 Dec 2008 15:37:45 +0100 + +ghostscript (8.63.dfsg.1-0ubuntu12) jaunty; urgency=low + + * debian/patches/65_too-big-temp-files-1.dpatch: Ghostscript produced much too + big temporary files (> 10 GB) when printing photos from GNOME apps in + 1200 dpi. Part 1 of the fix which reduces the temp file size to less than + 2 GB (LP: #288570, upstream bug #690133). + + -- Till Kamppeter Wed, 3 Dec 2008 23:37:45 +0100 + +ghostscript (8.63.dfsg.1-0ubuntu11) jaunty; urgency=low + + * debian/patches/60_pxl-cups-driver-pdf.dpatch: The pstopxl filter did not + remove its temporary file after finishing. + + -- Till Kamppeter Sat, 29 Nov 2008 13:37:45 +0100 + +ghostscript (8.63.dfsg.1-0ubuntu10) jaunty; urgency=low + + * debian/ghostscript.postinst: Do not try to update the PPDs of existing + print queues if CUPS is not installed or not running (LP: #302532). + + -- Till Kamppeter Wed, 26 Nov 2008 22:26:45 +0100 + +ghostscript (8.63.dfsg.1-0ubuntu9) jaunty; urgency=low + + * debian/ghostscript.postinst: Added automatic update of the PPD files + of already existing print queues. + + -- Till Kamppeter Wed, 26 Nov 2008 18:18:22 +0100 + +ghostscript (8.63.dfsg.1-0ubuntu8) jaunty; urgency=low + + * Release for assorted upstream fixes. + + * debian/patches/52_cups-device-logging.dpatch: Made logging of the "cups" + output device much less verbose. The log of one jub in debug mode did not + fit into the maximum log file size of CUPS. + + * debian/patches/55_pcl-input-slot-fix.dpatch: Made the paper tray selection + via "-dMediaPosition=..." in the PCL 4/5/5e drivers work (Upstream bug + #690182). + + * debian/patches/57_pxl-input-slot-fix.dpatch: Made the paper tray selection + via "-dMediaPosition=..." in the PCL 6/XL drivers work. + + * debian/patches/60_pxl-cups-driver-pdf.dpatch: Made the PCL-XL CUPS filter + and PPDs work with PDF input. + + * debian/patches/62_onebitcmyk-pdf.dpatch: Check the whole Decode array to + detect special cases of identity and inverse decoding in PDF files + (Upstream bug #690178). + + -- Till Kamppeter Wed, 26 Nov 2008 11:30:22 +0200 + +ghostscript (8.63.dfsg.1-0ubuntu7) jaunty; urgency=low + + * debian/local/pdftoraster/pdftoraster.c, + debian/local/pdftoraster/pdftoraster.convs, debian/rules: Added pdftoraster + filter from the Ghostscript SVN repository (LP: #290395). + + * debian/control: Added conflict with cups < 1.3.9-4 because the pdftoraster + filter was there before. + + * debian/patches/50_lips4-floating-point-exception: Fixed floating-point + exception in "lips4" and other drivers (Upstream bug #690122). + + -- Till Kamppeter Tue, 11 Nov 2008 10:33:22 +0200 + +ghostscript (8.63.dfsg.1-0ubuntu6) intrepid; urgency=low + + * debian/patches/42_gs-init-ps-delaybind-fix.dpatch: Make "ps2ascii" working + again (LP: #281419, upstream bug #690124). + + * debian/patches/45_bjc600-bjc800-pdf-input.dpatch: Fix setting of the + "DitheringType" option. With PDF input Ghostscript crashes, with + PostScript input the "DitheringType" option was probably ignored + (Upstream bug #690032). + + * debian/patches/48_cups-output-device-pdf-duplex-uninitialized-memory.patch.dpatch: + Fixed several bugs in the "cups" (CUPS Raster) output device: + - Ghostscript crashed with PDF input data + - The "Duplex" and "MediaWeight" options were ignored + - There was uninitialized memory and wrong usage of pointers, potential + cause for segmentation faults or even vulnerabilities + - There were mismatches in data types, leading to possible breakage + of the "AdvanceDistance", "MediaWeight", and "cupsStringXX" options. + (Upstream bug #690101). + + -- Till Kamppeter Sun, 19 Oct 2008 12:48:22 +0200 + +ghostscript (8.63.dfsg.1-0ubuntu5) intrepid; urgency=low + + * debian/patches/38_pxl-duplex.dpatch: The Duplex option of the "pxlmono" + and "pxlcolor" drivers did not work (part 1 of the fix for LP: #282738). + + * debian/patches/39_pxl-resolution.dpatch: The resolution must be also set + as PJL command for the "pxlmono" and "pxlcolor" drivers. + + -- Till Kamppeter Mon, 13 Oct 2008 22:55:22 +0200 + +ghostscript (8.63.dfsg.1-0ubuntu4) intrepid; urgency=low + + * debian/control, debian/rules: Merge ghostscript-fonts back into + ghostscript, since this is not needed at present. + * debian/rules: Drop most of the fonts from ghostscript since gsfonts + ships newer versions. + + -- Steve Langasek Thu, 21 Aug 2008 07:29:40 +0000 + +ghostscript (8.63.dfsg.1-0ubuntu3) intrepid; urgency=low + + * debian/rules: Fixed typo (LP: #256975). + * debian/ghostscript.links: s/8.62/8.63/ + * debian/patches/35_disable_libcairo.dpatch: Added possibility to + compile Ghostscript without the "cairo" output device. The device + is still in experimental state and with its dependency on libcairo + it pulls in a dependency on X. + * debian/control, debian/rules: Build Ghostscript without the "cairo" + output device (LP: #256859). + + -- Till Kamppeter Mon, 11 Aug 2008 17:10:22 +0200 + +ghostscript (8.63.dfsg.1-0ubuntu2) intrepid; urgency=low + + * debian/control, debian/rules: Split the fonts off into its own + "ghostscript-fonts" package. Changes dependencies of "ghostscript" + package that either "ghostscript-fonts" or "gsfonts" can be used. + + -- Till Kamppeter Mon, 11 Aug 2008 10:10:22 +0200 + +ghostscript (8.63.dfsg.1-0ubuntu1) intrepid; urgency=low + + * New upstream release + * Merge from debian unstable, remaining changes: + - gs-esp and gs-common depend only on ghostscript, not on ghostscript-x, + as gs-esp had already split off gs-esp-x in Ubuntu + * debian/patches/12_gs-cjk_vertical_writing_metrics_fix.dpatch, + debian/patches/30_ps2pdf_man_improvement.dpatch: Adapted to upstream + changes. + * debian/control: Added libcairo2-dev to the build dependencies, as + Ghostscript has a libcairo-based output device now. + + -- Till Kamppeter Tue, 5 Aug 2008 11:10:22 +0200 + +ghostscript (8.62.dfsg.1-3.2) unstable; urgency=low + + * Non-maintainer upload. + * Make ghostscript depend on gs-common to prevent removal. + Drop gs-common -> ghostscript-x dependency to not force the + X version on all users. Hopefully Closes: #503712. + + -- Thomas Viehmann Sun, 28 Dec 2008 11:18:18 +0100 + +ghostscript (8.62.dfsg.1-3.1) unstable; urgency=medium + + * Non-maintainer upload. + * Add (empty) gs-common.prerm to enable upgrades + etch->lenny to succeed when the old gs-common.prerm + fails. Closes: #495703. + Thanks to Niko Tyni for the bug report and analysis. + + -- Thomas Viehmann Sun, 31 Aug 2008 22:26:34 +0200 + +ghostscript (8.62.dfsg.1-3) unstable; urgency=low + + * Acknowledged NMU, thanks madcoder - closes: #453903 + * Bumped to Standards-Version: 3.8.0. + * Fixed fakeroot build error, thanks Bob Lindell - closes: #484712 + * ghostscript-doc.doc-base: Made file mask *.htm* instead of *.html. + + -- Masayuki Hatta (mhatta) Sun, 20 Jul 2008 08:59:17 +0900 + +ghostscript (8.62.dfsg.1-2.1ubuntu1) intrepid; urgency=low + + * Merge from debian unstable, remaining changes: + - gs-esp and gs-common depend only on ghostscript, not on ghostscript-x, + as gs-esp had already split off gs-esp-x in Ubuntu + * debian/libgs8.shlibs: Removed. All libgs8 versions should have the same + API and ABI. The artificial restriction set by this file required all + reverse dependencies to be rebuilt for every stable release of Ghostscript. + * debian/ghostscript.doc-base: Removed. The file conflicts with the + corresponding file of ghostscript-doc and it also points to documentation + files which make only part of ghostscript-doc, so the files can be not + installed when this doc-base file is installed. + * debian/ghostscript-doc.doc-base: Corrected file mask for all HTML files. + The Ghostscript documentation is in *.htm files. + + -- Till Kamppeter Mon, 9 Jun 2008 18:41:22 +0200 + +ghostscript (8.62.dfsg.1-2.1) unstable; urgency=high + + * Non-maintainer upload. + * Add patches/31_fix-gc-sigbus.dpatch to avoid sigbus/segfaults on sparc and + hppa (and probably errors on other architectures as well). + Closes: #453903. + + -- Pierre Habouzit Wed, 14 May 2008 15:25:03 +0200 + +ghostscript (8.62.dfsg.1-2) unstable; urgency=low + + * ghostscript: Tighten up versioned dependency on libgs8 + - closes: #470253 + * preinsts for each dummy packages now call update-alternatives + to make sure gs symlinks are removed before the new ghostscript + package is installed - closes: #449173 + + -- Masayuki Hatta (mhatta) Thu, 13 Mar 2008 02:30:51 +0900 + +ghostscript (8.62.dfsg.1-1) unstable; urgency=low + + * New upstream release. + * Removed Resource/Font for a minor licensing problem. + I'm now contacting the upstream, so they might be back soon. + * Fixed in the upstream - closes: #418706 + See also http://bugs.ghostscript.com/show_bug.cgi?id=689600 + * Now it can handle DEB_BUILD_OPTS as expected - closes: #446819 + * 10_ijs_krgb_support.dpatch: incorporated into the upstream, removed. + * 27_cups_filters_with_buffered_input.dpatch: incorporated into + the upstream, removed. + * 28_print_encrypted_PDFs_from_adobe_reader_8.dpatch: incorporated into + the upstream, removed. + * 31_CVE-2008-0411.dpatch: incorporated into the upstream, removed. + thanks Nico Golde for NMU. + * shlibs: loosen the libgs8 shlibs version specification, + thanks Sune Vuorela for pointing it out - closes: #469218 + * control: ghostscript doesn't provide gs, gs-esp, gs-gpl, gs-afpl + and gs-aladdin anymore - ghostscript-x does - closes: #448702, #462678 + * control: tighten up versioned Conflicts on dummy packages. + * rules: removes /usr/share/doc/ghostscript/README.gz explicitly + - closes: #460692 + * postinst: removes old /etc/alternative symlinks explicitly + - closes: #447495, #449061 + + -- Masayuki Hatta (mhatta) Sun, 09 Mar 2008 10:39:31 +0800 + +ghostscript (8.61.dfsg.1-1.1) unstable; urgency=high + + * Non-maintainer upload by security team. + * Fix stack based buffer overflow in the zseticcspace() function possibly + leading to arbitrary code exeuction via a crafted ps file. + (31_CVE-2008-0411.dpatch; Closes: #468190). + * Adjusting libgs shlibs file to match the new version number. + + -- Nico Golde Sat, 01 Mar 2008 11:18:27 +0100 + +ghostscript (8.61.dfsg.1-1ubuntu3) hardy; urgency=low + + * SECURITY UPDATE: buffer overflow in color space handling code + * debian/patches/31_CVE-2008-0411.dpatch: fix zseticcspace() to perform + range checks + * References + CVE-2008-0411 + + -- Jamie Strandboge Tue, 08 Apr 2008 11:58:11 -0400 + +ghostscript (8.61.dfsg.1-1ubuntu2) hardy; urgency=low + + * Fix debian/libgs8.shlibs for ubuntu version number + + -- Jonathan Riddell Sat, 16 Feb 2008 18:45:47 +0000 + +ghostscript (8.61.dfsg.1-1ubuntu1) hardy; urgency=low + + * Merge from debian unstable, remaining changes: + - gs-esp and gs-common depend only on ghostscript, not on ghostscript-x, + as gs-esp had already split off gs-esp-x in Ubuntu + - Updated the KRGB patch from HP to the newest upstream version with + added checks for null forward device in the graphic procedures to fix + segfault bug LP: #69905 and corrected "force banding" code in gsijs_open + for small images (IE: hagaki in landscape). + + -- Till Kamppeter Wed, 6 Feb 2008 17:41:22 +0100 + +ghostscript (8.61.dfsg.1-1) unstable; urgency=low + + [Masayuki Hatta] + + * New upstream release. + * Now pdf2dsc can handle PageLabels properly - closes: #266166 + * Bumped up Standards-Version to 3.7.3 (no physical changes). + * NEWS, README.Debian, copyright: Revised. + * NEWS: Fixed wrong version number - closes: #454514, #454515 + * Sorted out dpatches: + 01-09: Debian-specific patches + 10-19: Bigger 3rd party patches (KRGB & CJKV) + 20-: Temporary bug fixes (should be incorporated into the upstream) + * debian/patches/29_gs_css_fix.dpatch: Fixes a syntax error in gs.css + - closes: #457118 + * debian/patches/30_ps2pdf_man_improvement.dpatch: Improved manpages for + ps2pdf - closes: #193461 + + [Till Kamppeter] + + * debian/patches/09_ijs_krgb_support.dpatch: Adapted to upstream changes. + * debian/rules: Updated CUPS-related variables for "make install" calls. + * debian/rules: Remove /usr/include/ghostscript from the ghostscript + package, they go into libgs-dev. + * debian/patches/40_cups_filters_with_buffered_input.dpatch: Modified + cups/psto* filters to let Ghostscript always use buffered input. This + works around a Ghostscript bug which prevents printing encrypted PDF + files with Adobe Reader 8.1.1 and Ghostscript built as shared library + (Ghostscript bug #689577, Ubuntu bug LP: #172264) + * debian/patches/42_print_encrypted_PDFs_from_adobe_reader_8.dpatch: + Fixed printing of encrypted PDF files from Adobe Reader 8.1.1. This + is the real fix now and not only a workaround. (Ghostscript bug + #689577, Ubuntu bug LP: #172264). + + -- Masayuki Hatta (mhatta) Sun, 13 Jan 2008 02:13:25 +0900 + +ghostscript (8.61.dfsg.1-0ubuntu5) hardy; urgency=low + + * debian/rules: Do not ship README.gz in ghostscript, it collides with + ghostscript-doc. (LP: #185602, Debian #460692) + + -- Martin Pitt Wed, 30 Jan 2008 11:11:03 +0100 + +ghostscript (8.61.dfsg.1-0ubuntu4) hardy; urgency=low + + * debian/patches/09_ijs_krgb_support.dpatch: Updated the KRGB patch from + HP to the newest upstream version with added checks for null forward + device in the graphic procedures to fix segfault bug LP: #69905 and + corrected "force banding" code in gsijs_open for small images (IE: + hagaki in landscape). + + -- Till Kamppeter Wed, 23 Jan 2008 13:17:43 +0000 + +ghostscript (8.61.dfsg.1-0ubuntu3) hardy; urgency=low + + * debian/patches/42_print_encrypted_PDFs_from_adobe_reader_8.dpatch: + Fixed printing of encrypted PDF files from Adobe Reader 8.1.1. This is + the real fix now and not only a workaround. (Ghostscript bug #689577, + Ubuntu bug LP: #172264). + + -- Till Kamppeter Mon, 12 Dec 2007 12:17:43 +0000 + +ghostscript (8.61.dfsg.1-0ubuntu2) hardy; urgency=low + + * Merge with Debian unstable. Remaining Ubuntu changes: + - gs-esp and gs-common depend only on ghostscript, not on ghostscript-x, + as gs-esp had already split off gs-esp-x in Ubuntu + - Upstream version 8.61 final + * debian/patches/40_cups_filters_with_buffered_input.dpatch: Modified + cups/psto* filters to let Ghostscript always use buffered input. This + works around a Ghostscript bug which prevents printing encrypted PDF + files with Adobe Reader 8.1.1 and Ghostscript built as shared library + (Ghostscript bug #689577, Ubuntu bug LP: #172264) + + -- Till Kamppeter Wed, 5 Dec 2007 13:17:43 +0000 + +ghostscript (8.61.dfsg.1-0ubuntu1) hardy; urgency=low + + * New upstream release + o Final 8.61 release + * debian/patches/09_ijs_krgb_support.dpatch: Adapted to upstream changes. + * debian/rules: Updated CUPS-related variables for "make install" calls. + * debian/rules: Remove /usr/include/ghostscript from the ghostscript + package, they go into libgs-dev. + + -- Till Kamppeter Thu, 22 Nov 2007 12:17:43 +0000 + +ghostscript (8.61.dfsg.1~svn8187-3) unstable; urgency=low + + * Maintainer upload. + * Acknowledged NMU, thanks Cyril - closes: #422723, #430337 + * 06_libpaper_support.dpatch: fixed to cope with being called repeatedly. Thanks Carlos Garcia Campos - closes: #453048 + * debian/watch: Now it works. Thanks Raphael Geissert - closes: #449310 + + -- Masayuki Hatta (mhatta) Wed, 05 Dec 2007 06:06:23 +0900 + +ghostscript (8.61.dfsg.1~svn8187-2.1) unstable; urgency=low + + * Non-maintainer upload. + * Fix long-standing implicit pointer conversions by backporting a fix from + SVN revision 8232, as pointed by Dann Frazier (Closes: #422723): + - 40_implicit_pointer_conversion_fix.dpatch added for this purpose. It + also contains an additional tweak for src/gpmisc.c so that no attempt + to use fdopen64() is made, fdopen() is the way to go. That tweak also + solves the FTBFS on GNU/kFreeBSD (Closes: #430337). + - DEB_AUTO_UPDATE_AUTOCONF set to “yes” in debian/rules so that the + configure script gets updated at build time (the needed build + dependencies are already there). + + -- Cyril Brulebois Sat, 24 Nov 2007 06:35:17 +0100 + +ghostscript (8.61.dfsg.1~svn8187-2) unstable; urgency=low + + * Maintainer upload, acknowledged NMU - closes: #447188 + * Made all dummy packages depend on ghostscript AND ghostscript-x, so + their nominal "functionality" should virtually be the equivalent to + the former gs|gs-gpl|gs-esp|gs-afpl packages - closes: #446825 + * Revised debian/copyright - closes: #444468, #444467 + * debian/rules: Clean files from package ghostscript which are moved to + ghostscript-doc on i386 (where arch-all packages are built). On all + non-i386 platforms the files remained in the main package, which + causes file conflicts and unnecessary package growth - closes: #446927 + (fix from Ubuntu) + * debian/patches/06_libpaper_support.dpatch: Added missing "#include + ", this made Ghostscript not working at all on IA64 - closes: + #428055 (fix from Ubuntu) + + -- Masayuki Hatta (mhatta) Wed, 31 Oct 2007 02:27:38 +0900 + +ghostscript (8.61.dfsg.1~svn8187-1.1) unstable; urgency=high + + * Non-maintainer upload by testing security team. + * Included 31-CVE-2007-2721.dpatch to fix remote + user-assisted denial of service via malformed image + files in embedded copy of jasper (Closes: #447188) + + -- Nico Golde Sat, 20 Oct 2007 12:46:44 +0200 + +ghostscript (8.61.dfsg.1~svn8187-1) unstable; urgency=low + + * New upstream release - closes: #437848, #291452 + * Important CJK handling fixes are absent from the current 8.60 or SVN, so I + decided to use this SVN snapshots until the issue is fixed (Ubuntu does the same). + * Can be built with the modern GCC now - closes: #440427 + * Complete re-organization: gs-gpl, gs-esp and gs-afpl are discontinued and + gone altogether, and now there's only one ghostscript package - closes: #52603, #159516, #434791, #394628, #394350, #295377, #246983, #416253, #323867 + * Imported Ubuntu's various improvements on packaging. + Thanks for Ubuntu people, especially Till Kamppeter. + * Sorted out dummy packages - closes: #321989, #401137 + * Separated -doc package - closes: #138549, #391082, #389872 + * Separated -x package, the main ghostscrpt doesn't depend X anymore - cloese: #76814, #393980, #240215 + * Separated libgs* packages - closes: #344351 + * Enabled cdj880 driver - closes: #157067 + * Enabled Lexmark 3200 driver - closes: #157067 + * Enabled pcl3 driver - closes: #259075 + * Added /usr/share/fonts/type1/gsfonts to fontpath - closes: #434310 + * Sorted out licensing information. + * Removed jasper/doc/*.pdf since those are shipped without + "transparent" copies a la GFDL. + + -- Masayuki Hatta (mhatta) Sun, 14 Oct 2007 22:24:34 +0900 + +ghostscript (8.61.dfsg.1~svn8187-0ubuntu4) hardy; urgency=low + + * debian/rules: Clean /usr/share/doc/*.html files from package + 'ghostscript', too (incomplete fix in previous versions), since they are + already shipped in ghostscript-doc and thus have a file conflict. + (LP: #153218) + + -- Martin Pitt Mon, 22 Oct 2007 17:21:21 +0200 + +ghostscript (8.61.dfsg.1~svn8187-0ubuntu3) gutsy; urgency=low + + [ Till Kamppeter ] + * debian/rules: Install missing *.upp files (usptream bug, LP: #150985). + + [ Martin Pitt ] + * debian/rules: Clean files from package ghostscript which are moved to + ghostscript-doc on i386 (where arch-all packages are built). On all + non-i386 platforms the files remained in the main package, which causes + file conflicts and unnecessary package growth. This is a quick hack for + Gutsy. In Hardy, this horribly broken build system should be fixed + properly. + + -- Martin Pitt Tue, 09 Oct 2007 23:00:28 +0200 + +ghostscript (8.61.dfsg.1~svn8187-0ubuntu2) gutsy; urgency=low + + * debian/patches/06_libpaper_support.dpatch: Added missing + "#include ", this made Ghostscript not working at all + on IA64 (Fixes LP: #130842, thanks to Ralph Giles from ghostscript.com + for the fix and to Matthias Klose for the IA64 test machine). + * debian/ghostscript.links: Bumped version number in link for CJK fonts + (Fixes LP: #139911). + + -- Till Kamppeter Tue, 18 Sep 2007 10:00:58 +0100 + +ghostscript (8.61.dfsg.1~svn8187-0ubuntu1) gutsy; urgency=low + + * New upstream release + o SVN snapshot rev 8187 + o CJK patches from Koji Otani to fix several issues with CJK text + (should fix http://bugs.ghostscript.com/show_bug.cgi?id=689304). + These patches were also applied to ESP Ghostscript and having them + in Gutsy's GPL GS will avoide regressions against Feisty's ESP GS. + o Minor bug fixes from upstream. + + -- Till Kamppeter Mon, 13 Aug 2007 21:49:58 +0100 + +ghostscript (8.60.dfsg.6-0ubuntu2) gutsy; urgency=low + + * debian/patches/30_assorted_script_fixes.dpatch: Back out the update + to pdf2eps, causing build failures on the buildds. + * debian/control: Build-depend on freeglut3-dev | libglut-dev. + + -- Matthias Klose Fri, 10 Aug 2007 10:50:08 +0200 + +ghostscript (8.60.dfsg.6-0ubuntu1) gutsy; urgency=low + + * Final release of Ghostscript 8.60 + o First official release of GPL Ghostscript with merged functionality + of ESP Ghostscript. + o Closes: LP: #128801 + * debian/patches/50_gv_kghostview_compatibility.dpatch: Removed workaround, + real fix done upstream + + -- Till Kamppeter Thu, 02 Aug 2007 02:13:11 +0100 + +ghostscript (8.60.dfsg.5-0ubuntu1) gutsy; urgency=low + + * New upstream release + o SVN snapshot rev 8127 + o Carried over some bug fixes from ESP Ghostscript (see + http://bugs.ghostscript.com/show_bug.cgi?id=689315) + o Minor bug fixes from upstream. + * debian/patches/30_assorted_script_fixes.dpatch: Updated. + + -- Till Kamppeter Mon, 16 Jul 2007 17:43:58 +0100 + +ghostscript (8.60.dfsg.4-0ubuntu1) gutsy; urgency=low + + * New upstream release + o SVN snapshot rev 8050 + o From now on we take snapshots from the trunk, as the merger of ESP and + GPL Ghostscript is completed and moved into the trunk. The branch + "gs-esp-gpl-merger" has been removed. + o Minor bug fixes from upstream. + * debian/patches/50_gv_kghostview_compatibility.dpatch: Updated. + + -- Till Kamppeter Thu, 14 Jun 2007 2:53:50 -0700 + +ghostscript (8.60.dfsg.3-0ubuntu2) gutsy; urgency=low + + * debian/control: + + Make gsfonts a Depends instead of Recommends as it was before on the + gs-common package. This fixes the GStreamer build failure. + + -- Sebastian Dröge Tue, 12 Jun 2007 21:15:25 +0200 + +ghostscript (8.60.dfsg.3-0ubuntu1) gutsy; urgency=low + + * New upstream release + o SVN snapshot rev 8025, branch "gs-esp-gpl-merger" + o Minor bug fixes from upstream. + * debian/rules: Renamed executable /usr/bin/gsc to /usr/bin/gs to not + conflict with the gambc package (Fixes LP: #118785). + + -- Till Kamppeter Wed, 06 Jun 2007 17:22:27 +0100 + +ghostscript (8.60.dfsg.2-0ubuntu2) gutsy; urgency=low + + * debian/ghostscript.preinst: + - Only remove the gs alternatives on upgrades from before + 8.60.dfsg.2-0ubuntu1, and don't let the lack of alternatives fail + installation. + - Remove "rm -rf /etc/ghostscript /etc/gs-gpl" insanity. + + -- Martin Pitt Fri, 01 Jun 2007 14:18:02 +0200 + +ghostscript (8.60.dfsg.2-0ubuntu1) gutsy; urgency=low + + * New upstream release + o SVN snapshot rev 7997, branch "gs-esp-gpl-merger" + o Added functionality to compile with shared libgs and without GTK + via "--disable-gtk" configure option (feature overtaken from ESP + Ghostscript). + o Minor bug fixes from upstream. + * debian/patches/40_fix_imdi_patch.dpatch: Removed, fixed upstream. + + -- Till Kamppeter Wed, 23 May 2007 11:54:11 +0100 + +ghostscript (8.60.dfsg.1-0ubuntu2) gutsy; urgency=low + + * debian/rules: Added forgotten option "--disable-gtk" to the "./configure" + command line, this prevented ghostscript from building on the build + servers. + * Added missing version number to "Conflicts: gs-common" in the ghostscript + package. + * Do away with the update-alternatives, we have one grand unified Ghostscript + now! + + -- Till Kamppeter Tue, 22 May 2007 21:38:21 +0100 + +ghostscript (8.60.dfsg.1-0ubuntu1) gutsy; urgency=low + + * This is the first Debian/Ubuntu package reflecting Artifex' move to do + the head development of Ghostscript under GPL and the merger of ESP + Ghostscript into GPL Ghostscript which followed after that. + * Renamed from "gs-gpl" to "ghostscript" on agreement with Debian Ghostscript + maintainer Masayuki Hatta + * New upstream release + o SVN snapshot rev 7979, branch "gs-esp-gpl-merger" + o This is the head of the Ghostscript development now. There is no separate + AFPL Ghostscript any more. See http://www.ghostscript.com/awki/News. + o All extra functionality of ESP Ghostscript is merged into GPL + Ghostscript now and the development of ESP Ghostscript is discontinued. + See http://www.cups.org/espgs/. + * debian/control: Added tags and transitional packages to make this package + (ghostscript) replacing gs-esp and gs-afpl (Closes: LP#47432, LP#47458, + LP#75894, LP#83769, LP#103595, LP#105752, LP#108159, LP#109304). + * debian/rules, debian/control, debian/dirs, debian/ghostscript.*, + debian/README.Debian, debian/gs.defoma: Merged in gs-common. + * debian/control: Set Ubuntu maintainer. + * debian/rules: Activated full functionality by appropriate "./configure" + command line options. This is now the one and only Ghostscript in Ubuntu + Linux. + * debian/rules: Do not build static executable, to reduce the build time + to one half of the former build time of gs-esp (or to not double the + build time of ghostscript). + * debian/rules, debian/control: Split package into ghostscript, libgs8, + libgs-dev, and ghostscript-x, like we did with gs-esp, also split off + documentation into ghostcript-doc. + * debian/NEWS: Added info about merger of ESP and GPL Ghostscript + * debian/patches/: Removed 01_gsdir_for_gs-gpl.dpatch, + 02_fontpath_for_debian, 20_additional_drivers, 21_additional_drivers_mak, + 22_gdi_support, 23_hl12x0_support: They are not needed any more after + merging in the ESP GS functionality and moving to "ghostscript" as + package name. + * debian/patches/09_ijs_krgb_support.dpatch: Updated to version 1.3 + of the KRGB patch (from HPLIP 1.7.3). + * debian/patches/04_gdevxini_segv_fix.dpatch: Removed, it makes the X + device being reopened on every page size change and breaks output with + tools like gv (gv hangs without showing any page). + * debian/patches/40_fix_imdi_patch.dpatch: Fixed imdi directory location + in src/devs.mak + * debian/patches/50_gv_kghostview_compatibility.dpatch: Fixed compatibility + with GUIs like gv and kghostview (see upstream bug 689237, + http://bugs.ghostscript.com/show_bug.cgi?id=689237, note: reintroduces + upstream bug 687125 but that bug is much less a problem). + * debian/ghostscript.postinst: update-alternatives configuration does not get + correctly updated when the obsolete gs-esp and gs-afpl packages get removed + via the transitional packages. Let the post-install script of the + ghostscript package reset update-alternatives to auto mode for such a case. + + -- Till Kamppeter Mon, 21 May 2007 13:00:21 +0100 + +gs-gpl (8.56.dfsg.1-1) unstable; urgency=low + + * New upstream release. + * man/gs.1: Paths are adjusted to Debian - closes: #405049 + * man/gs.1: Fixed various typos - closes: #323534 + * Fixed insecure /tmp usage in toolbin scripts (CAN-2005-2352) - closes: #291373 + * Now opdfread.ps is installed - closes: #401755 + + -- Masayuki Hatta (mhatta) Sat, 05 May 2007 00:58:39 +0900 + +gs-gpl (8.54.dfsg.1-5) unstable; urgency=high + + * Oops, I forgot to apply dpatch #20, so the large amount of drivers are missing in -4. Mea Culpa. + * Added Brother HL-1240/1250 support - closes: #280693 + * Make sure /etc/gs-gpl is removed - closes: #333474 + * Remove Fontmap and Fontmap.GS from the package - closes: #325400 + * Provides the index.html symlink - closes: #303792 + * Added binary-indep rules in debian/rules - closes: #267398 + + -- Masayuki Hatta (mhatta) Sat, 21 Oct 2006 10:25:56 +0900 + +gs-gpl (8.54.dfsg.1-4) unstable; urgency=high + + * Brought back KRGB colorspace support to ijs - closes: #355616 + * Brought back Samsung GDI support - closes: #365337 + * gs depends on gs-gpl | gs-esp - closes: #297024 + * rules, gs-gpl.links: s/8.15/8.54/g. + + -- Masayuki Hatta (mhatta) Wed, 18 Oct 2006 21:33:33 +0900 + +gs-gpl (8.54.dfsg.1-3) unstable; urgency=low + + * Supports big post table for CMap - closes: #205055 + * Fixed a potential segv problem in src/gdevxini.c, thanks Ian Jackson for providing a patch - closes: #254206 + + -- Masayuki Hatta (mhatta) Wed, 18 Oct 2006 03:48:57 +0900 + +gs-gpl (8.54.dfsg.1-2) unstable; urgency=high + + * Made qsort call in src/gxfcopy.c 64-bit clean, thanks Andreas - closes: #390875 + + -- Masayuki Hatta (mhatta) Thu, 12 Oct 2006 09:28:26 +0900 + +gs-gpl (8.54.dfsg.1-1) unstable; urgency=low + + * New upstream release - closes: #373805 + * Acknowledged NMUs, since crash on ppc has been fixed in the upstream - closes: #357326, #327288, #324796 + + -- Masayuki Hatta (mhatta) Tue, 26 Sep 2006 01:25:04 +0900 + +gs-gpl (8.50-1.1) unstable; urgency=high + + * Non-maintainer upload. + * debian/patches/00list: Re-enable patch 10_powerpc_crash_fix; upstream + delayed to fix after the 8.50 release. Cures segfaults on ppc (again). + Thanks to Roger Leigh for testing. Closes: #357326 + + -- Daniel Kobras Wed, 29 Mar 2006 14:22:21 +0200 + +gs-gpl (8.50-1) unstable; urgency=low + + * Works done at Codefest in Malaysia 2006. + * New upstream release - closes: #347637, #348834 + * Updated debian/watch - closes: #354352 + * Bumped to Standards-Version: 3.6.2.2 (no physical changes). + + -- Masayuki Hatta (mhatta) Sun, 5 Mar 2006 10:46:33 +0900 + +gs-gpl (8.15-4.1) unstable; urgency=low + + * Non-maintainer upload. + * Use gcc-3.4 on s390. + + -- Bastian Blank Thu, 29 Dec 2005 10:52:10 +0000 + +gs-gpl (8.15-4) unstable; urgency=low + + * Apply patch 10 working around a crashing bug on powerpc (details in + the patch file itself). This closes: bug#324796, #325570, #327288 + (thanks to Paul Brossier for first reporting, Ian + Jackson for providing the patch, and + Thomas Bushnell BSG for shouting about the problem). + + -- Jonas Smedegaard Mon, 19 Sep 2005 15:15:44 +0200 + +gs-gpl (8.15-3) unstable; urgency=low + + * Bumped Standards-Version to 3.6.2.1 (no physical changes). + * Removed patch 04, since it doesn't affect at all. + * Enabled jbig2dec support. + * Now uses cidfmap generated by defoma. + * gs-gpl.links: make a symlink of CMap directory under /usr/share/gs-gpl/8.15/Resource. + NOTE: even if CMap files can be found somewhere in the font path, gs-esp + fails to prepare a composed font with CIDFont and CMap. This hack is + a workaround for "the CMap files must be put into the first directory of + the font path" problem. Many Thanks Akira TAGOH for suggestion. + + -- Masayuki Hatta (mhatta) Thu, 18 Aug 2005 03:38:59 +0900 + +gs-gpl (8.15-2) unstable; urgency=low + + * Drop stp patch: + + Remove stp-related parts of additional_drivers patches 20 and 21. + + Drop build-dependency on libgimpprint-dev. + + Remove stp note from README.Debian. + + Closes: bug#313026 (thanks to Roger Leigh ). + + -- Jonas Smedegaard Wed, 20 Jul 2005 14:05:26 +0200 + +gs-gpl (8.15-1) unstable; urgency=low + + * Repackaged source tarball with non-free CMaps stripped. + * Added check in debian/rules to fail if CMaps exist in the source. + * Mention in debian/copyright that CMaps are stripped. + * Add myself as uploader (acknowledged by Masayuki), and re-upload as + regular maintainer upload. This package closes: bug#280352 (thanks + to some anonymous(?) lilypond-lover offering virtual beer for + pushing this newer release, and Wouter Verhelst + for delivering the message). + * Correct UTF8-encoding of debian/changelog. + + -- Jonas Smedegaard Fri, 15 Jul 2005 13:27:05 +0200 + +gs-gpl (8.15-0.1) unstable; urgency=low + + * NMU of newer upstream release. + * Update and unfuzz patches (Note: source patched by + 04_resourcedir_fix_for_debian slightly changed upstream, so may no + longer be needed). + * Use fine-grained X11 build-dependencies. + + -- Jonas Smedegaard Tue, 12 Jul 2005 10:52:11 +0200 + +gs-gpl (8.01-5) unstable; urgency=high + + * [NEWS] added a note on CJK TTF support. + * Revive Samsung GDI support, thanks plum - closes: #250180 + * Revive Brother 7x0 GDI support - closes: #253479 + * Added KRGB colorspace support to gs IJS driver - closes: #249166 + * Fix SEGV on -sDEVICE=bbox - closes: #250290, #254877 + * Adjust the margins for Epson drivers - closes: #48975 + * Now Suggests hpijs - closes: #161953 + + -- Masayuki Hatta (mhatta) Sun, 15 Aug 2004 13:03:15 +0900 + +gs-gpl (8.01-4) unstable; urgency=low + + * Fixed the priority to 20 - closes: #246983 + * Removed funky character in NEWS, thanks tbm for pointing it out. + + -- Masayuki Hatta (mhatta) Wed, 5 May 2004 16:09:24 +0900 + +gs-gpl (8.01-3) unstable; urgency=low + + * Added Build-Dep: libgimpprint1-dev - closes: #244143 + * Added lj3100sw driver - closes: #243963 + * Revised description. + * Added notes on stp. + + -- Masayuki Hatta (mhatta) Wed, 28 Apr 2004 05:40:05 +0900 + +gs-gpl (8.01-2) unstable; urgency=low + + * Added STP support culled from gimp-print 4.2.6. + + -- Masayuki Hatta (mhatta) Tue, 13 Apr 2004 13:20:31 +0900 + +gs-gpl (8.01-1) unstable; urgency=low + + * New maintainer with torsten's blessing. He is still a co-maintainer. + * The package name has been changed to gs-gpl. + * Now uses dpatch. + * Acknowledged NMUs - closes: #63163, #136652, #105179, #128314, #128416 + * New upstream release - closes: #235686, #226088 + * Revised copyright - closes: #226020 + * Moved *map under /etc/gs-gpl - closes: #179244 + * Do not run "update-alternatives --remove" when upgrade - closes: #163267 + * Improved libpaper support - closes: #182268 + * Set the font path appropriately - closes: #122828, #159816, #111874, #195931, #128955 + * Removed stp driver - closes: #170550 + * Added cfax driver - closes: #183438 + * Set the priority to 20. + + -- Masayuki Hatta (mhatta) Sat, 27 Mar 2004 00:00:05 +0900 + +gs (7.07-1) unstable; urgency=low + + * New upstream release. + + Uses /dev/urandom instead of /dev/random so does not block forever + waiting for quality random numbers (closes: #176850). + * Fix buffer overflow in gdevhpij.c (sizeof(PK) < PIPE_BUF...) and + remove the old patch (closes: #184345). + * debian/devices: Add pngalpha device. + + -- Torsten Landschoff Wed, 18 Jun 2003 10:51:53 +0200 + +gs (7.06-1.1) unstable; urgency=low + + * NMU + * Fix unconditional PIPE_BUF bug to build on GNU. (Closes: #184345) + + -- Robert Millan Sun, 13 Apr 2003 14:01:41 +0200 + +gs (7.06-1) unstable; urgency=low + + * New upstream release. + * debian/rules: + + Include History7.htm into the changelog. + + Kill the /usr/share/man/de hierarchy which only documents stuff + in gs-common, not even the gs command. + + -- Torsten Landschoff Thu, 3 Apr 2003 11:34:02 +0200 + +gs (7.05-3) unstable; urgency=low + + * Reextract the source without running ntpdate on another console + and rebuild to fix the search path (closes: #173493, #173560). + + -- Torsten Landschoff Fri, 20 Dec 2002 15:54:29 +0100 + +gs (7.05-2) unstable; urgency=low + + * debian/control: Conflicts, Provides and Replaces gs-pdfencrypt - that + functionality is now included in gs itself and the old stuff breaks + with current gs (closes: #173222). + * Apply the patch from Florian Zumbiehl (identical to the upstream + solution in newer releases) to fix the scaling of the psmono/psgray + driver - the output was scaled twice (closes: #171530). + + -- Torsten Landschoff Tue, 17 Dec 2002 11:44:44 +0100 + +gs (7.05-1) unstable; urgency=low + + * New upstream release. + * debian/control: Use libpng3-dev instead libpng2-dev. + + -- Torsten Landschoff Sun, 1 Sep 2002 01:10:37 +0200 + +gs (6.53-7) unstable; urgency=low + + * debian/rules (binary-arch): Use rm -Rf to kill the man dir as rm -R + seems to ask for permission for some users (closes: #152037). + + -- Torsten Landschoff Wed, 28 Aug 2002 01:28:36 +0200 + +gs (6.53-6) unstable; urgency=low + + * debian/devices: Enable the ljet4d driver as suggested by + Isidro Cachadiña Gutiérez. + + -- Torsten Landschoff Tue, 27 Aug 2002 11:29:17 +0200 + +gs (6.53-5) unstable; urgency=low + + * Apply the hpijs margin patch from + http://hpinkjet.sourceforge.net/gdevijs2.patch (closes: #151869). + + -- Torsten Landschoff Thu, 4 Jul 2002 09:54:39 +0200 + +gs (6.53-4) unstable; urgency=low + + * Enable the hl1240 driver (the hl1250 should already be there, but it + seems it isn't...). + * debian/control: Change build dependency on libgimpprint-dev to + libgimpprint1-dev. + + -- Torsten Landschoff Wed, 3 Jul 2002 19:36:58 +0200 + +gs (6.53-3) unstable; urgency=high + + * debian/copyright: Include information about add on packages and + their licenses. + + * debian/devices: Move x11 in front of x11alpha which has problems with + mono displays at least (closes: #138844). + * src/unix-gcc.mak: Reenable the pipe device as it seems harmless after + all and many filters will break as they are using this feature to + circumvent the old Ghostscript problem with -sOutputFile=- when + the PostScript file writes text to stdout which interferes with the + printer commands... (closes: #138364). + * debian/control: Remove the reference to gs-pdfencrypt which is now + obsolete as it is included in the official Ghostscript now. + + * Lintian cleanup: + + Remove the extra license file /usr/share/doc/gs/COPYING.gz + + Copying.htm stays as it is since it is linked in the docs + + Convert History[56].htm to changes.gz using html2text to have an + upstream changelog. + * Included a few important patches from the Ghostscript CVS: + + Handle the margins from an ijs server correctly. It was my hope that + this would account for #141608, but that does not seem to be the + case :( + + src/gdevx.c: Patched to use the "right" color depth on X11 for + all cases. It used to take the actual number of bits to store + the color info as opposed to the number of bits actually used. + + lib/pdf2dsc.ps: This was broken because of the security fix. + Patched to open the files before dropping privileges. + + * lib/stcolor.ps: Compare the product name with "GNU Ghostscript" instead + of just "Ghostscript" to detect the interpreter (closes: #108120). + * src/gdevbj10.c: Apply the patch to fix the margins for the Canon BJ10e + submitted by Jim Hague (closes: #118078). + * debian/postinst: Link the manpage to gs.1.gz as well as a slave of + the /usr/bin/gs alternative (closes: #122538). + * gimp-print/README.stp: Copy from gimp-print source tree. + * debian/docs: Install that file as $(docdir)/README.stp for those + using that driver and needing some infos (closes: #122099). + + debian/README.Debian: Refer the user to README.stp. + * debian/rules: Install the documentation of the pcl3 driver + (closes: #39342). + * debian/docs: Add the README.lexmark of the lexmarkgs driver to the + installed documentation. + + -- Torsten Landschoff Tue, 9 Apr 2002 02:29:10 +0200 + +gs (6.53-2) unstable; urgency=high + + * [SECURITY] src/unix-gcc.mak: Disable the pipe device as well since it + still allows executing arbitrary commands. I'll turn it back on when I am + sure it does not cause any security problems. + + -- Torsten Landschoff Thu, 7 Mar 2002 12:24:53 +0100 + +gs (6.53-1) unstable; urgency=high + + * New upstream release (closes: #130426). + + Fixes the security problem allowing reading all files and + executing random commands (closes: #136652). + * debian/gen-makefile: Fix the BUILD_OPTIONS check (closes: #121871). + * Should fix the cjk stuff I hope (closes: #116516). In case there is + another problem please could somebody provide me with information + how to check that it works? I am more than deeply frustrated with + getting readmes in japanese, web pages in japanese etc. That's just + deeply frustrating. + + -- Torsten Landschoff Wed, 6 Mar 2002 01:20:30 +0100 + +gs (6.51-7) unstable; urgency=medium + + * Urgency medium because it works around a bug breaking the package + on one Debian architecture. + * src/gxobj.h [IA64]: Lock the object alignment to 16 bytes, as the + initial setjmp segfaults because of a bad alignment. jmp_buf needs + to be on 16 byte boundaries for this arch. This is a quick work + around until somebody comes up with a better fix - at least it + gets gs to work on ia64 - I am not certain how much memory overhead + this causes though. Kudos to John Daily for his + investigative work. I am leaving the bug open for now, since it does + not really fix the problem (#128314). + + -- Torsten Landschoff Tue, 8 Jan 2002 21:12:22 +0100 + +gs (6.51-6) unstable; urgency=low + + * ijs/*: Include the ijs driver from the hpijs source. + * debian/devices: Add ijs to the device list. + * src/contrib.mak: Include ijs/contrib.mak-6.51.add + + -- Torsten Landschoff Mon, 31 Dec 2001 15:00:45 +0100 + +gs (6.51-5) unstable; urgency=low + + * gimp-print/gdevstp.c: Update from gimp-print 4.1.99-rc1 (closes: #120009) + + -- Torsten Landschoff Fri, 16 Nov 2001 14:29:11 +0100 + +gs (6.51-4) unstable; urgency=low + + * src/gdevxini.c: Apply the patch supplied by Chanop Silpa-Anan + (closes: #85811). Thanks for your support, Chanop! + * debian/gen-makefile: Add /usr/share/ghostscript/common to the + search path to get gs-pdfencrypt working again (closes: #119406). + * Download the lex5000 driver and include it in the build system + (closes: #58657). + * debian/devices: Add lx5000, lex5000. + + -- Torsten Landschoff Wed, 14 Nov 2001 16:47:57 +0100 + +gs (6.51-3) unstable; urgency=low + + * debian/devices: Enabled the cfax driver as requested by a user. + + -- Torsten Landschoff Fri, 9 Nov 2001 17:48:23 +0100 + +gs (6.51-2) unstable; urgency=low + + * Enable the Brother HL 1250 driver (closes: #63027). + + -- Torsten Landschoff Wed, 17 Oct 2001 12:07:23 +0200 + +gs (6.51-1) unstable; urgency=low + + * New upstream release (closes: #101928). + * The new upstream release fixes many problems with the interpreter. + These bugs were fixed in Ghostscript 6.0: + + the font rendering problem in X11 is fixed (closes: #28579) + + ps2pdf does not write rectangles for polygons anymore (closes: #36200) + + the PDF which crashed gs does not lead to any problems (closes: #45361) + + a PDF which was inverted by pdf2ps stays black on + white now (closes: #49659). + + Philipp's file crashing gs does not do so anymore (closes: #58468) + + the invalid LanguageGroup in fonts does not cause gs to abort + anymore (closes: #67462). + + another PDF file which caused a crash is working now (closes: #89995) + * Rewrote the build system. + * The libjpeg sources are now included in the diff which is not nice + but working (closes: #87896). + * lynx is not used anymore to convert the changelog to plain text + (closes: #93722). + * The hpijs driver is now included upstream (closes: #106294). + * Driver support for the Apple Imagewriter is now included (closes: #110740). + * Make the package use update-alternatives so that different gs packages + can cooperate (closes: #98227). + * Add in the gdi driver provided by Daniel Burrows (closes: #105885). + * debian/devices: Add omni to the list + + debian/gen-makefile: Add threading and dynamic linking support. + * debian/control: Add libglib1.2-dev to the Build-Depends as it is + needed for the Omni driver. + * debian/devices: Go through the list of available drivers and add + what we seem to be able to build. Among the new devices: + - cdj970 (closes: #112434) + - cljet5, cljet5pr, cljet5c + - dl2100, hl7x0 + - the generic hpijs device (supports hpijs 0.97, closes: #102369, #110657) + - imagen, inferno, jetp3852 + - lex2050, lex3200, lex5700 + - oki4w + - plan9bm + - psrgb + - x11cmyk2, x11cmyk4, x11cmyk8, x11gray4 + * src/contrib.mak: Add missing generic hpijs device. + * Enable stp driver and link with libgimpprint + (closes: #82454, #87004, #103036) + * debian/control: Build-Depend on libgimpprint-dev. + * debian/gen-makefile: Add support for the DEB_BUILD_OPTIONS environment + variable (more precisely, the debug option leads to a build with + debugging support and exported private variables). + * Add in the CJK support using the patch from + Yasuhiro Take . A huge "THANK YOU" to him for his + work!!! His changes: + + Add debian/patches/gs-cjk-M2-R1+CJKPDF.diff & .info, and apply it + to the source. + + debian/control: Conflicts: Add gs-cjk-resource (<< 1.20010910-1) because + the new gs-cjk patch requires new gs-cjk-resource that i've already + prepared and doesn't work with older ones. + + debian/control: Depends: Add gs-common (>= 0.2) because font + configuration for the new gs-cjk patch is completely different from + the old one. + * debian/control: Removed the conflict with gs_x, gs_svga and gs_both. + I don't even remember when those packages where in Debian, probably + before Debian 1.3 so a direct upgrade is going to fail anyway. And + with intermediate upgrades it will not be a problem. + * src/imainarg.c: Reapply the papersize diff from debian/patches. + + -- Torsten Landschoff Tue, 16 Oct 2001 21:06:14 +0200 + +gs (5.50-8) unstable; urgency=low + + * debian/rules: Use html2text to convert the html changelog into + plain text instead of lynx (closes: #93722). + * debian/control: Update Build-Depends. + * debian/prerm: Fix the case to handle both removal and upgrade + instead of handling upgrading in two cases (closes: #98458). + * debian/control: Merge multi-line Build-Depends into one line for + now until our tools support multi line fields (closes: #98459). + + -- Torsten Landschoff Mon, 4 Jun 2001 01:22:36 +0200 + +gs (5.50-7) unstable; urgency=low + + * debian/postrm: Add missing #DEBHELPER# (arg!). + * debian/prerm: Add defoma-app clean on upgrade. + * debian/gs.templates: Remove the double negation of the previewer + question (closes: #94146). + * Merge german translation for debconf templates (closes: #93840). + * debian/shlibs.local: Depend on svgalibg1 or svgalib-dummyg1 + alternatively (closes: #93811). + + -- Torsten Landschoff Tue, 1 May 2001 22:24:55 +0200 + +gs (5.50-6) unstable; urgency=low + + * debian/README: + + Move copyright info to debian/copyright. + + Mention the align.ps file (closes: #67317). + * gdevbbox.c: Use default color methods instead of NULL pointers so + that gs -sDEVICE=bbox does not crash anymore (closes: #36883). + + -- Torsten Landschoff Sat, 7 Apr 2001 21:09:55 +0200 + +gs (5.50-5) unstable; urgency=low + + * debian/default_path.sh: + + Include defoma dir in search path. + + Search local directories before system directories. + + Defoma is preferred if available... + * debian/postinst: Fix the hopefully last bashism (s/source/g/). + * Included support for Hewlett Packard's own printer driver called + hpijs (closes: #92010). Note that you will need the hpijs package + for using it. + + -- Torsten Landschoff Sat, 7 Apr 2001 02:40:15 +0200 + +gs (5.50-4) unstable; urgency=low + + * Install interesting Postscript files as examples (closes: #79461). + * Finally include the missing if-hpdj filter (closes: #63705). + * Also add the documentation of hp8xx (closes: #63566). + + -- Torsten Landschoff Thu, 5 Apr 2001 03:58:27 +0200 + +gs (5.50-3) unstable; urgency=low + + * debian/rules: + + Don't remove debian/postinst anymore in clean target. + + Read package and version info from changelog. + + Convert to debhelper. + * debian/postinst: Again rewritten from scratch (guess why!? *arg*) + + -- Torsten Landschoff Thu, 5 Apr 2001 02:34:17 +0200 + +gs (5.50-2) unstable; urgency=low + + * debian/postinst: Completely rewritten. + + Fixes the bashism reported by Joey Hess (closes: #92056). + + Does not mess with /usr/local anymore (closes: #57276). + * unix-gcc.mak: Readd the x11 device (closes: #92586). + * debian/config: Change the priority of the defoma questions to + low. I don't see how the defaults can cause any problems. + * debian/shlibs.local: Removed. Let's see if it works without. + + -- Torsten Landschoff Thu, 5 Apr 2001 01:36:09 +0200 + +gs (5.50-1) unstable; urgency=low + + * Finally upgrade to new upstream version, still based on the old + package (the reimplementation is still under the hood ;) + (closes: #65832, #87673). + * unix-gcc.mak: Make x11alpha the default device on X11 as already + done in gs-aladdin. Modern systems should be able to handle the + anti aliasing fast enough. + * debian/control: Update build dependencies for new X11. + * debian/control: Removed Conflicts with local defoma packages made + by Yasuhiro. + * debian/patches/svgalib: Adjust for name change of the main Makefile + and move the targets out of the ifeq so that one can run the file + standalone. + * debian/patches/hpdj: + - Don't patch zmedia2.c since upstream changed it since 5.10. + - Adjust for name change of the main makefile. + - Use the right patch from the hpdj distribution for 5.50. + * debian/patches/hp8xx: + - Update the devs.mak diff for gs 5.50. + - Adjust for name change of main makefile. + * debian/rules: Disable kanji and jpdrivers support (needs update for 5.50). + * debian/patches/lexmarkgs: + - Update the devs.mak diff for 5.50. + * debian/control: Add missing build-depends (closes: #82114, #88393). + * debian/rules: Make debian/addentry executable before running it + (closes: #90278). + * time_.h: Include as well as sys/time.h (closes: #90433, #88391). + + -- Torsten Landschoff Thu, 29 Mar 2001 01:17:54 +0200 + +gs (5.10-11.5defoma2) unstable; urgency=low + + * Add kanji patches. + + -- Yasuhiro Take Tue, 27 Mar 2001 20:58:55 +0900 + +gs (5.10-11.5defoma1) unstable; urgency=low + + * Add Defoma support. + * Remove kanji patches. + + -- Yasuhiro Take Tue, 20 Mar 2001 18:21:22 +0900 + +gs (5.10-11) unstable; urgency=low + + * debian/control: Added build time dependency for libfreetype2-dev + (closes: #82114). + * Included upp files for stc740 printer provided by Gregory P. Smith + (closes: #76845). + + -- Torsten Landschoff Mon, 15 Jan 2001 00:53:32 +0100 + +gs (5.10-10.1) stable unstable; urgency=high + + * Non-maintainer upload by security team + * Patch from Werner Fink: + + Create temporary files securely using mkstemp instead of mktemp + + Don't set LD_RUN_PATH to empty, that makes the runtime linker look + in the current path as well + + -- Wichert Akkerman Wed, 22 Nov 2000 03:35:35 +0100 + +gs (5.10-10) unstable; urgency=low + + * contrib/kanji/man/ps2jpdf.1: Changed ".SH PS2JPDF" into ".SH NAME" + (closes: #59925, #60002, #60474). + * debian/rules: Added -isp to call of dpkg-gencontrol (lintian). + + -- Torsten Landschoff Wed, 15 Mar 2000 23:30:41 +0100 + +gs (5.10-9) frozen unstable; urgency=high + + * Applied patch from Colin Phipps to fix security problem in ps2epsi + (closes: #57034) + + -- Torsten Landschoff Sun, 6 Feb 2000 02:24:33 +0100 + +gs (5.10-8) frozen unstable; urgency=low + + * Only a simple change to close a bugreport: The package contained a + directory in /usr/local in violation with policy. Sorry for this, + the directories are now created by the postinst (closes: #56396). + + -- Torsten Landschoff Fri, 28 Jan 2000 09:52:17 +0100 + +gs (5.10-7) frozen unstable; urgency=low + + * This can go into frozen since the changes are absolutely simple. + * debian/control: Fixed build dependencies (closes: #55451). + * debian/patches/hpdj: Added installation of margin files as requested in + #39342 (for gs-aladdin). + * gcc-head.mak: Added path for local fonts as requested in #31898 + (/usr/local/lib/ghostscript/{common,5.10,fonts}) + * debian/rules: Make the directories intended for local fonts. + * gs.1: Added documentation for local postscript files. + + -- Torsten Landschoff Thu, 20 Jan 2000 12:47:48 +0100 + +gs (5.10-6) unstable; urgency=low + + * Added driver for Lexmark 7000. Thanks to Alex Winbow for pointing + me to the patch. + * debian/rules: Completely rewritten and a bit modularized. + * hpdj driver updated to version 2.6. + + -- Torsten Landschoff Wed, 12 Jan 2000 20:24:44 +0100 + +gs (5.10-5) unstable; urgency=low + + * New maintainer. + * debian/control: Added build dependencies. + * Applied patch from Taketoshi Sano to remove copyrighted stuff from + the package (closes: #52575). + * This release is based on Wicherts NMU (thanks for the work Wichert!) + closes: #53071 + + -- Torsten Landschoff Wed, 29 Dec 1999 22:22:02 +0100 + +gs (5.10-4.1) unstable; urgency=low + + * Non-maintainer upload + * Apply patch to fix mac ttf rendering, Closes: Bug#52590 + + -- Wichert Akkerman Sun, 19 Dec 1999 17:05:38 +0100 + +gs (5.10-4) unstable; urgency=low + + * Small patch applied to file gs_init.ps, so that japanese + fonts are required only for japanese people (many thaks to + Fumitoshi Ukai) (closes: Bug#49725, #49732, #49867) + + -- Marco Pistore Fri, 12 Nov 1999 12:45:37 +0100 + +gs (5.10-3) unstable; urgency=low + + * Many thanks to Taketoshi Sano for his great job + with the Japanese support (closes Bug#41570) + + -- Marco Pistore Sun, 7 Nov 1999 02:56:13 +0100 + +gs (5.10-2.0.vflib.2) experimental; urgency=low + + * Non Maintainer. + * Add support for many drivers included in gs510j49 + * FHS transition + * Lintian free + + -- Taketoshi Sano Sun, 31 Oct 1999 09:21:06 +0900 + +gs (5.10-2.0.vflib.1) experimental; urgency=low + + * Non Maintainer. + * Experimental revision for Japanese VFlib support enhancement. + * Please check and modify this experimental revision to add + Japanese support on the Debian package of "gs" + + -- Taketoshi Sano Sat, 30 Oct 1999 15:03:07 +0900 + +gs (5.10-2) unstable; urgency=low + + * Added support for hp8xx drivers by Uli Wortmann (closes Bug#40807). + * Added support for epsf and ttfont features. + * Changed "Aladdin Ghostscript" into "GNU Ghostscript" in + file stcolor.ps e stcinfo.ps (closed Bug#35411, Bug#35525). + + -- Marco Pistore Sat, 10 Jul 1999 23:29:57 +0200 + +gs (5.10-1) unstable frozen; urgency=low + + * Ghostscript 5.10 is GPL! + This package essentially corresponds to package gs-aladdin_5.10-12, + but redistributed under GPL. Changes w.r.t. gs-aladdin_5.10-12 + are: + * Corrected "regulamentations" --> "regulations" + in description of package. + * Filenames in script pdf2ps are now enclosed in double quotes + * Fixed the manpages for bdftops, printafm and wftopfa, + so that they work with apropos. + The various patches to ghostscript 5.10 that have been proposed + by L.P.Deutsch and that appear in gs-aladdin_5.10-12 also appear + in this package. + + -- Marco Pistore Sun, 3 Jan 1999 18:22:57 +0100 + +gs (4.03-6) unstable; urgency=low + + * Moved to version 2.5 of hpdj driver by Martin Lottermoser (debian/rules + is changed accordingly). + * Mentined package gsfonts in description of gs. + + -- Marco Pistore Mon, 7 Dec 1998 22:06:21 +0100 + +gs (4.03-5) frozen unstable; urgency=low + + * Fixed the manpages for bdftops, printafm and wftopfa, + so that they work with apropos. + + * Removed *.1.gz files from /usr/doc/gs (they already are in the + /usr/man/man1 directory). + + -- Marco Pistore Fri, 6 Nov 1998 10:52:31 +0100 + +gs (4.03-4) frozen unstable; urgency=low + + * Fixed files stcolor.ps and stcinfo.ps so that they recognize that + they are called by GNU ghostscript; thanks to Gordon Matzigkeit + (closes Bug#28726). + + -- Marco Pistore Thu, 5 Nov 1998 21:44:07 +0100 + +gs (4.03-3) unstable; urgency=low + + * Changed "Recommends: gs-pdfencrypt" to "Suggests: gs-pdfencrypt" in + control file (closes Bug#27431) + * Removed "Provides: gs_x, gs_svga, gs_both", since "_" cannot appear + in package names, and no packages should depend on these quite old + virtual packages. + * Changed directory name for the libjpeg source from ../libjpeg-6a + to ../libjpeg: so it does not depend on the particular version + of libjpeg (changes in files gcc-head.mak, debian/rules and + debian/jpeg). + * Linked against libjpeg-6b. + + -- Marco Pistore Sat, 10 Oct 1998 00:01:15 +0200 + +gs (4.03-2) unstable; urgency=low + + * Now /usr/lib/ghostscript/common is searched for library files + before /usr/lib/ghostscript/X.YY (where X.YY is the version of + ghostscript). This is useful for installing packages like + gs-pdfencrypt, that provide (modified) library files + to ghostscript that are independent from the version of gs + (also gs.1 is changed accordingly) + * Now gs-pdfencrypt (in the nonUS distribution) is suggested by + gs-aladdin. Changed the message in the file pdf_sec.ps so that + it suggests to install that package if an encrypted pdf file is + being processed. + * Linked against libpng2 (closes Bug#26924) + + -- Marco Pistore Tue, 29 Sep 1998 21:01:10 +0200 + +gs (4.03-1) unstable; urgency=low + + * New upstream version (gs 4.03 is finally GPL!!!) + * Pristine source + * Set options in gcc-head.mak + * Added man pages for all the binaries + * All example files in /usr/doc/gs/examples start now with %! + * Script font2c moved from /usr/bin to /usr/lib/ghostscript + (there is really no reason to put this script in /usr/bin) + * Patched devs.mak and gdevpng.c so to work with version 0.96 of libpng. + * Patched gdevcdj.c so that device cdeskjet works + (and is identical to cdj500) + * Patched gdevl256.c imainarg.c so that superuser rights are given away + as soon as possible, and re-obtained only to start svgalib (see + /usr/doc/gs/README.Debian and /usr/doc/gs/setuid.Debian) + * Patched imainarg.c to set default paper accordig to the system paper + as reported by libpaper, also patched imaiarg.c so that the lvga256 + device is chosen as the default one if gs is not called from X + * Patched zlib.mak: here the shared file for zlib is called libz, + not libgz + + -- Marco Pistore Thu, 4 Jun 1998 20:29:47 +0100 + +gs (3.33-7) unstable; urgency=low + + * Corrected address of FSF in copyright file + * All the scripts start now with #! + * Added man pages for all the binaries + * bdftops, font2c and wftopfa moved from /usr/bin to + /usr/lib/ghostscript + (there is really no reason to put these scripts in /usr/bin) + * gs.real moved to /usr/lib/ghostscript (it should not be + called by the user) + + -- Marco Pistore Thu, 12 Mar 1998 20:29:38 +0100 + +gs (3.33-6) unstable; urgency=low + + * New maintainer + * Libc6 (hamm) release + * Minor fixes in debian/rules + * Bug 10270 fixed: now manpages are compressed + * Bug 9935 fixed: package works with svgalib-dummy + * Redundant dependencies removed in debian/control + (this also fixes Bug 9157) + * Now device cdeskjet works (and is identical to cdj500) + + -- Marco Pistore Mon, 29 Sep 1997 20:41:47 +0200 + +gs (3.33-5) stable; urgency=low + + * Examples used to be in /usr/doc/$(examples)/examples, but $(examples) + was empty (should have been $(package), must have been sleeping) + + -- joost witteveen Fri, 7 Feb 1997 15:15:37 +0100 + +gs (3.33-4) stable; urgency=low + + * debian/rules didn't install some files in ./debian/tmp, but in /!!! + Why do I need root to build packages? + * Minor fix in wrapper.c (no change in binary) + + -- joost witteveen Tue, 21 Jan 1997 19:15:53 +0100 + +gs (3.33-3) stable; urgency=low + + * apparently, gs-3.33 never got compiled with all devices (only a + pitiful few ones). Fixed this. + + -- joost witteveen Fri, 8 Nov 1996 21:49:49 +0100 + +gs (3.33-2) unstable; urgency=low + + * Converted to new source format + * Removed the "+1" bug in the wrapper that caused coredumps with + libc5.4.7 + * included x11alpha x11cmyk devices + * removed dependancy on gsfonts + * Improved argument parsing of wrapper + * Stripped the executables + * Fixed discription bug "This version is aladdin coright,..."! + (Sorry!) + + -- joost witteveen Thu, 31 Oct 1996 20:56:01 +0100 + --- ghostscript-8.71.dfsg.1.orig/debian/ghostscript.prerm +++ ghostscript-8.71.dfsg.1/debian/ghostscript.prerm @@ -0,0 +1,50 @@ +#! /bin/sh +# prerm script for ghostscript +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove) +# install-info --quiet --remove /usr/info/ghostscript.info.gz + if type defoma-app >/dev/null 2>&1; then + defoma-app -t purge gs + fi + update-alternatives --remove-all ps2pdf + ;; + upgrade) + if type defoma-app >/dev/null 2>&1; then + defoma-app -t clean gs + update-alternatives --remove-all ps2pdf + fi + ;; + deconfigure) +# install-info --quiet --remove /usr/info/ghostscript.info.gz + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 --- ghostscript-8.71.dfsg.1.orig/debian/compat +++ ghostscript-8.71.dfsg.1/debian/compat @@ -0,0 +1 @@ +4 --- ghostscript-8.71.dfsg.1.orig/debian/gs-afpl.preinst +++ ghostscript-8.71.dfsg.1/debian/gs-afpl.preinst @@ -0,0 +1,45 @@ +#!/bin/sh +# preinst script for gs-esp +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) + # Do away with update-alternative for /usr/bin/gs, we have one + # grand unified Ghostscript now! + if dpkg --compare-versions "$2" lt-nl "8.63.dfsg.1-1"; then + update-alternatives --remove-all gs || true + update-alternatives --remove-all gs.1 || true + fi + + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- ghostscript-8.71.dfsg.1.orig/debian/dirs +++ ghostscript-8.71.dfsg.1/debian/dirs @@ -0,0 +1,5 @@ +usr/bin +usr/share/defoma/scripts +etc/defoma/config +var/lib/defoma/gs.d/dirs/fonts +var/lib/defoma/gs.d/dirs/CMap --- ghostscript-8.71.dfsg.1.orig/debian/gs-aladdin.preinst +++ ghostscript-8.71.dfsg.1/debian/gs-aladdin.preinst @@ -0,0 +1,45 @@ +#!/bin/sh +# preinst script for gs-aladdin +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) + # Do away with update-alternative for /usr/bin/gs, we have one + # grand unified Ghostscript now! + if dpkg --compare-versions "$2" lt-nl "8.63.dfsg.1-1"; then + update-alternatives --remove-all gs || true + update-alternatives --remove-all gs.1 || true + fi + + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- ghostscript-8.71.dfsg.1.orig/debian/gs-esp.preinst +++ ghostscript-8.71.dfsg.1/debian/gs-esp.preinst @@ -0,0 +1,45 @@ +#!/bin/sh +# preinst script for gs-esp +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) + # Do away with update-alternative for /usr/bin/gs, we have one + # grand unified Ghostscript now! + if dpkg --compare-versions "$2" lt-nl "8.63.dfsg.1-1"; then + update-alternatives --remove-all gs || true + update-alternatives --remove-all gs.1 || true + fi + + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- ghostscript-8.71.dfsg.1.orig/debian/NEWS +++ ghostscript-8.71.dfsg.1/debian/NEWS @@ -0,0 +1,55 @@ +ghostscript (8.61.dfsg.1~svn8187-1) unstable; urgency=low + + As the ESP Ghostscript development is discontinued now, the extra + functionality of ESP Ghostscript is merged into upstream GPL Ghostscript + from version 8.60 on. This is the first Debian/Ubuntu package of this + merged Ghostscript. It contains the following added functionality from + ESP Ghostscript: + + - Enhanced PCL XL driver. + - Shared library and driver (X11) support for Linux/UNIX. + - The CUPS "driver" that generates a series of raster + images for CUPS printer drivers. + - Nearly all known free printer drivers which have to + be compiled into Ghostscript - drivers listed with + "Execution style: Ghostscript" on openprinting.org. + Not included are some obsolete drivers such as hpdj + which is replaced by the included pcl3 driver. + - All known Uniprint configuration files (*.upp) as + listed on openprinting.org. + - Patches to add the NOMEDIAATTRS option to Ghostscript, + which allows CUPS drivers to use media options + separate from Ghostscript. + - KRGB support for IJS drivers. + - OpenPrinting Vector interface + - Support files for CUPS. + - Enhanced build system (easy driver selection, font + search path setting, ...). + + This package has everything activated. + + Due to Ghostscript's head development being under GPL now, and all important + functionality being developed at ghostscript.com, forks are not needed any + more. This makes gs-esp, gs-afpl, and gs-common obsolete. gs-gpl is also + renamed to ghostscript now, so that it can be found in repositories more + easily. This new ghostscript package automatically removes all gs-* packages. + + -- Till Kamppeter Mon, 21 May 2007 13:00:21 +0100 + +gs-gpl (8.01-5) unstable; urgency=low + + For CJKV users: GPL gs 8.x does not contain CJK TrueType font + support (it still has CJK CID font support, though), so you can not + use CJK *.ttf/ttc with gs-gpl. I strongly urge you to use + gs-esp for the time being. + + -- Masayuki Hatta (mhatta) Sun, 15 Aug 2004 13:26:21 +0900 + +gs-gpl (8.01-3) unstable; urgency=low + + Currently gs-gpl has stp support, but please note that this driver + will be removed after sarge's release since stp has been obsoleted + by ijs (ijsgimpprint). Those of you who still use stp are strongly + recommended to migrate to ijsgimpprint ASAP. + + -- Masayuki Hatta (mhatta) Wed, 28 Apr 2004 05:40:05 +0900 --- ghostscript-8.71.dfsg.1.orig/debian/copyright +++ ghostscript-8.71.dfsg.1/debian/copyright @@ -0,0 +1,426 @@ +This package was debianized by Masayuki Hatta (mhatta) on +Tue, 23 Mar 2004 19:46:37 +0900. + +It was downloaded from http://ghostscript.com/releases/ + +Note: The directory Resource/CMap is stripped from the source tarball, +as its content is not GPL-licensed (only verbatim copying is allowed). +Also, jasper/doc/*.pdf have been removed since their corresponding +sources are not available. + +Upstream Author: artofcode LLC. + +Copyright: Copyright (c) Artifex Software Inc., All Rights Reserved. + +From LICENSE: + + The files in the base, psi, lib, toolbin, examples, doc and man + directories (folders) and any subdirectories (sub-folders) + thereof are part of GPL Ghostscript. + + The files in the Resource directory and any subdirectories thereof + are also part of GPL Ghostscript, with the explicit exception of + the files in the CMap subdirectory. The CMap files are copyright + Adobe Systems Incorporated and covered by a separate license + which permits only verbatim distribution. + + GPL Ghostscript is free software; you can redistribute it and/or + modify it under the terms the GNU General Public License as + published by the Free Software Foundation, either version 3 + of the License, or (at your option) any later version. + + GPL Ghostscript is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program so you can know your rights and responsibilities. + It should be in a file named doc/COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place Suite 330, Boston, MA + 02111-1307, USA. + + --- + + GPL Ghostscript contains an implementation of techniques covered by + US Patents 5,055,942 and 5,917,614, and corresponding international + patents. These patents are licensed for use with GPL Ghostscript + under the following grant: + + Whereas, Raph Levien (hereinafter "Inventor") has obtained patent + protection for related technology (hereinafter "Patented + Technology"), Inventor wishes to aid the the GNU free software + project in achieving its goals, and Inventor also wishes to increase + public awareness of Patented Technology, Inventor hereby grants a + fully paid up, nonexclusive, royalty free license to practice the + patents listed below ("the Patents") if and only if practiced in + conjunction with software distributed under the terms of any version + of the GNU General Public License as published by the Free Software + Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + USA. Inventor reserves all other rights, including without + limitation, licensing for software not distributed under the GNU + General Public License. + + 5055942 Photographic image reproduction device using digital + halftoning to screen images allowing adjustable coarseness + + 5917614 Method and apparatus for error diffusion screening of + images with improved smoothness in highlight and shadow + regions + +On Debian systems, the complete text of the GNU General Public License +Version 2 can be found in `/usr/share/common-licenses/GPL-2'. + +The GPL Ghostscript distribution contains several third party +software, and some of them are governed by different licenses instead +of GNU GPL2. + +For files in the icclib directory: + + ************************************************************************* + Copyright (c) 1997-2002 Graeme W. Gill + + Permission is hereby granted, to use, copy, modify, distribute, and + sell this software and its associated documentation files (the + "Software") for any purpose without fee, provided that: + + 1) The above copyright notices and this permission notice + accompany all source code copies of the Software and + related documentation. and + + 2) If executable code based on the Software only is + distributed, then the accompanying documentation must + aknowledge that "this software is based in part on the work + of Graeme W. Gill". and + + 3) It is accepted that Graeme W. Gill (the "Author") accepts + NO LIABILITY for damages of any kind. The Software is + provided without fee by the Author "AS-IS" and without + warranty of any kind, express, implied or otherwise, + including without limitation, any warranty of + merchantability or fitness for a particular purpose. and + + 4) These conditions apply to any software derived from or + based on the Software, not just to the unmodified library. + and + + 5) Except as contained in this notice, or in the required + acknowledgment, the name of the Author, or the name of any + organization or company affiliated with the Author may not + be used in any advertising or publicity relating to the + Software, without the specific, prior written permission of + the Author. + + ************************************************************************* + +For files in the jasper directory: + + JasPer License Version 2.0 + + Copyright (c) 1999-2000 Image Power, Inc. + Copyright (c) 1999-2000 The University of British Columbia + Copyright (c) 2001-2003 Michael David Adams + + All rights reserved. + + Permission is hereby granted, free of charge, to any person (the + "User") obtaining a copy of this software and associated + documentation files (the "Software"), to deal in the Software + without restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, and/or sell copies of the + Software, and to permit persons to whom the Software is furnished to + do so, subject to the following conditions: + + 1. The above copyright notices and this permission notice (which + includes the disclaimer below) shall be included in all copies or + substantial portions of the Software. + + 2. The name of a copyright holder shall not be used to endorse or + promote products derived from the Software without specific prior + written permission. + + THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS + LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT + UNDER THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT + HOLDERS "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY + RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY + DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + OF THIS SOFTWARE. NO ASSURANCES ARE PROVIDED BY THE COPYRIGHT + HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE THE PATENT OR OTHER + INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. EACH COPYRIGHT + HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS BROUGHT BY ANY + OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS + OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS GRANTED + HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE + ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE + IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN + MISSION-CRITICAL SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF + NUCLEAR FACILITIES, AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, + AIR TRAFFIC CONTROL SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR + WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE SOFTWARE OR SYSTEM + COULD LEAD DIRECTLY TO DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR + ENVIRONMENTAL DAMAGE ("HIGH RISK ACTIVITIES"). THE COPYRIGHT + HOLDERS SPECIFICALLY DISCLAIM ANY EXPRESS OR IMPLIED WARRANTY OF + FITNESS FOR HIGH RISK ACTIVITIES. + + (jasper/doc/*.pdf have been removed since their corresponding + sources are not available - ed.) + +For files in the jbig2dec directory: + + The files in this directory (folder) and any subdirectories + (sub-folders) thereof are part of jbig2dec, with the exception of + certain source files included to support portability which are + marked otherwise in their copyright headers. + + jbig2dec is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as + published by the Free Software Foundation. + + This software is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program in the file named COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + + In addition, specific permission is given to link jbig2dec to or + compile jbig2dec into AFPL Ghostscript and to distribute same under + the AFPL license. + +For files in the jpeg directory: + + (Quoted from jpeg/README) + + LEGAL ISSUES + ============ + + The authors make NO WARRANTY or representation, either express or + implied, with respect to this software, its quality, accuracy, + merchantability, or fitness for a particular purpose. This software + is provided "AS IS", and you, its user, assume the entire risk as to + its quality and accuracy. + + This software is copyright (C) 1991-1998, Thomas G. Lane. All + Rights Reserved except as specified below. + + Permission is hereby granted to use, copy, modify, and distribute + this software (or portions thereof) for any purpose, without fee, + subject to these conditions: (1) If any part of the source code for + this software is distributed, then this README file must be + included, with this copyright and no-warranty notice unaltered; and + any additions, deletions, or changes to the original files must be + clearly indicated in accompanying documentation. (2) If only + executable code is distributed, then the accompanying documentation + must state that "this software is based in part on the work of the + Independent JPEG Group". (3) Permission for use of this software is + granted only if the user accepts full responsibility for any + undesirable consequences; the authors accept NO LIABILITY for + damages of any kind. + + These conditions apply to any software derived from or based on the + IJG code, not just to the unmodified library. If you use our work, + you ought to acknowledge us. + + Permission is NOT granted for the use of any IJG author's name or + company name in advertising or publicity relating to this software + or products derived from it. This software may be referred to only + as "the Independent JPEG Group's software". + + We specifically permit and encourage the use of this software as the + basis of commercial products, provided that all warranty or + liability claims are assumed by the product vendor. + + ansi2knr.c is included in this distribution by permission of + L. Peter Deutsch, sole proprietor of its copyright holder, Aladdin + Enterprises of Menlo Park, CA. ansi2knr.c is NOT covered by the + above copyright and conditions, but instead by the usual + distribution terms of the Free Software Foundation; principally, + that you must include source code if you redistribute it. (See the + file ansi2knr.c for full details.) However, since ansi2knr.c is not + needed as part of any program generated from the IJG code, this does + not limit you more than the foregoing paragraphs do. + + The Unix configuration script "configure" was produced with GNU + Autoconf. It is copyright by the Free Software Foundation but is + freely distributable. The same holds for its supporting scripts + (config.guess, config.sub, ltconfig, ltmain.sh). Another support + script, install-sh, is copyright by M.I.T. but is also freely + distributable. + + It appears that the arithmetic coding option of the JPEG spec is + covered by patents owned by IBM, AT&T, and Mitsubishi. Hence + arithmetic coding cannot legally be used without obtaining one or + more licenses. For this reason, support for arithmetic coding has + been removed from the free JPEG software. (Since arithmetic coding + provides only a marginal gain over the unpatented Huffman mode, it + is unlikely that very many implementations will support it.) So far + as we are aware, there are no patent restrictions on the remaining + code. + + The IJG distribution formerly included code to read and write GIF + files. To avoid entanglement with the Unisys LZW patent, GIF + reading support has been removed altogether, and the GIF writer has + been simplified to produce "uncompressed GIFs". This technique does + not use the LZW algorithm; the resulting GIF files are larger than + usual, but are readable by all standard GIF decoders. + + We are required to state that + "The Graphics Interchange Format(c) is the Copyright property of + CompuServe Incorporated. GIF(sm) is a Service Mark property of + CompuServe Incorporated." + + (The LZW Patent is now void - ed.) + +For files in the libpng directory: + + This copy of the libpng notices is provided for your convenience. + In case of any discrepancy between this copy and the notices in the + file png.h that is included in the libpng distribution, the latter + shall prevail. + + COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: + + If you modify libpng you may insert additional notices immediately + following this sentence. + + libpng versions 1.2.6, August 15, 2004, through 1.2.18, May 15, + 2007, are Copyright (c) 2004, 2006-2007 Glenn Randers-Pehrson, and + are distributed according to the same disclaimer and license as + libpng-1.2.5 with the following individual added to the list of + Contributing Authors + + Cosmin Truta + + libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, + 2002, are Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are + distributed according to the same disclaimer and license as + libpng-1.0.6 with the following individuals added to the list of + Contributing Authors + + Simon-Pierre Cadieux + Eric S. Raymond + Gilles Vollant + + and with the following additions to the disclaimer: + + There is no warranty against interference with your enjoyment of + the library or against infringement. There is no warranty that + our efforts or the library will fulfill any of your particular + purposes or needs. This library is provided with all faults, and + the entire risk of satisfactory quality, performance, accuracy, + and effort is with the user. + + libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, + are Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are + distributed according to the same disclaimer and license as + libpng-0.96, with the following individuals added to the list of + Contributing Authors: + + Tom Lane + Glenn Randers-Pehrson + Willem van Schaik + + libpng versions 0.89, June 1996, through 0.96, May 1997, are + Copyright (c) 1996, 1997 Andreas Dilger Distributed according to the + same disclaimer and license as libpng-0.88, with the following + individuals added to the list of Contributing Authors: + + John Bowler + Kevin Bracey + Sam Bushell + Magnus Holmgren + Greg Roelofs + Tom Tanner + + libpng versions 0.5, May 1995, through 0.88, January 1996, are + Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. + + For the purposes of this copyright and license, "Contributing + Authors" is defined as the following set of individuals: + + Andreas Dilger + Dave Martindale + Guy Eric Schalnat + Paul Schmidt + Tim Wegner + + The PNG Reference Library is supplied "AS IS". The Contributing + Authors and Group 42, Inc. disclaim all warranties, expressed or + implied, including, without limitation, the warranties of + merchantability and of fitness for any purpose. The Contributing + Authors and Group 42, Inc. assume no liability for direct, + indirect, incidental, special, exemplary, or consequential damages, + which may result from the use of the PNG Reference Library, even if + advised of the possibility of such damage. + + Permission is hereby granted to use, copy, modify, and distribute + this source code, or portions hereof, for any purpose, without fee, + subject to the following restrictions: + + 1. The origin of this source code must not be misrepresented. + + 2. Altered versions must be plainly marked as such and must not be + misrepresented as being the original source. + + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + + The Contributing Authors and Group 42, Inc. specifically permit, + without fee, and encourage the use of this source code as a + component to supporting the PNG file format in commercial products. + If you use this source code in a product, acknowledgment is not + required but would be appreciated. + + + A "png_get_copyright" function is available, for convenient use in + "about" boxes and the like: + + printf("%s",png_get_copyright(NULL)); + + Also, the PNG logo (in PNG format, of course) is supplied in the + files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). + + Libpng is OSI Certified Open Source Software. OSI Certified Open + Source is a certification mark of the Open Source Initiative. + + Glenn Randers-Pehrson + glennrp at users.sourceforge.net + May 15, 2007 + +For files in the zlib directory: + + Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + + The data format used by the zlib library is described by RFCs + (Request for Comments) 1950 to 1952 in the files + http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt + (deflate format) and rfc1952.txt (gzip format). --- ghostscript-8.71.dfsg.1.orig/debian/watch +++ ghostscript-8.71.dfsg.1/debian/watch @@ -0,0 +1,8 @@ +# Example watch control file for uscan +# Rename this file to "watch" and then you can run the "uscan" command +# to check for upstream updates and more. +# Site Directory Pattern Version Script +version=3 +opts=uversionmangle=s/-gpl$//,dversionmangle=s/\.dfsg.+// \ +http://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/current/ghostscript-(\d+.+)\.tar\.gz + --- ghostscript-8.71.dfsg.1.orig/debian/README.Debian +++ ghostscript-8.71.dfsg.1/debian/README.Debian @@ -0,0 +1,124 @@ +ghostscript for Debian +====================== + +Reconstruction +-------------- + +This package is merged from the former gs-gpl, gs-esp, and gs-common +packages, see debian/NEWS file. + + -- Masayuki Hatta (mhatta) , Sun, 13 Jan 2008 07:58:25 +0900 + +Removal of non-free files +------------------------- + +I removed the directory Resource/Cmap and its contents from the +upstream source tarball since their licensing policy does not conform +to the DFSG. Also, jaspter/doc/*.pdf have been removed since their +corresponding sources are not available. + + -- Masayuki Hatta (mhatta) , Wed Apr 28 06:31:45 2004 + +Font handling with Defoma +------------------------- + +The font configuration for Ghostscript is now controlled by Defoma. + +If you want to update the font configuration, run: + + defoma-app update gs + +Then the Defoma-configuration script for gs is called. + +Following describes what the Defoma-configuration script for gs does. + +Ghostscript accepts "type1", "type3", "gsfontderivative", "truetype", +"cid", "cmap" and "psprint" categories. gs registers all PostScript +fonts available to gs in the postscript category with / added to +the front of their names. + +Ghostscript creates files under /var/lib/defoma/gs.d/dirs. This +directory contains CMap and fonts subdirectories, and the CMap +subdirectory is symlinked under /usr/share/ghostscript. + +If you want to have a certain PostScript font name which is not +provided by registered fonts as RealName or Alias, you can have such a +font name substituted. Run + + defoma-subst edit-rule ghostscript + +to edit the subst-rule. + +For example, if you want to have Charter-Bold available whose charset +is ISO8859-1 and which has serifed, proportionally-spaced bold face, +you should add the following line: + +Charter-Bold --Charset,* ISO8859-1 --GeneralFamily Roman --Weight Bold +--Width Variable --Shape Upright Serif + +Then Charter-Bold will be substituted by the most similar font and +become available. + +The way to have CJK font substituted changes compared to the old +gs-aladdin (6.50-x). If you want to have Korean PostScript font, +Dotum-Medium-KSC-EUC-H available whose actual font name is +Dotum-Medium and KSC-EUC-H is a name of CMap, you should add the +following line: + +Dotum-Medium --CIDRegistry,* Adobe --CIDOrdering,* Korea1 --Weight Medium --Shape Upright + +Then Dotum-Medium-* (* is a name of Korean CMap) are substituted and +become available. + +Following is a list of hinttypes specific to gs. + +* GS-OriginFont, GS-OriginID: These hinttypes are used in + gsfontderivative category. The content of a font within this + category is a small PostScript program that generates a + derivative font from a certain substantial type1 or type3 font. + Generally a derivative font has bold or oblique shape, while + the original font has normal upright shape. + A font within this category must specify the original font and + its RealName with GS-OriginFont and GS-OriginID hinttypes. + +1. type1 and type3 + +Fonts within this category are handled in the same way. Symlink to the +fontfile is created under /var/lib/defoma/gs.d/dirs/fonts, and its +font name, font file and alises are listed in Fontmap. + +2. gsfontderivative + +Fonts within this category are handled in the similar way. Only one +difference is that dependency on the origin of the font is registered +when fonts are registered to Id cache. + +3. truetype + +Fonts within this category are handled in the same way as type1 and +type3 if the font doesn't include CJK glyphs. CJK truetype fonts goes +different. It is treated as a cid font. + +4. cid + +Symlink to the font file is created under +/var/lib/defoma/gs.d/dirs/fonts, and its font name, font file and +aliases are listed in CIDFnmap. Using registered CMaps which belong +to the same CIDRegistry and CIDOrdering, - are +registered in postscript category. + +5. cmap + +Symlink to the CMap file is created under +/var/lib/defoma/gs.d/dirs/CMap. Using registered CID fonts which +belong to the same CIDRegistry and CIDOrdering, +- are registered in postscript category. + +6. psprint + +Fonts installed in a PostSciprt printer should be previewable by +ghostscript. They are registered to psprint category, so the script +accepts this category and add the fonts and their hints to a +subst-rule. + + -- Masayuki Hatta (mhatta) , Sat, 21 Oct 2006 05:21:11 +0900 --- ghostscript-8.71.dfsg.1.orig/debian/gs-common.preinst +++ ghostscript-8.71.dfsg.1/debian/gs-common.preinst @@ -0,0 +1,45 @@ +#!/bin/sh +# preinst script for gs-common +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) + # Do away with update-alternative for /usr/bin/gs, we have one + # grand unified Ghostscript now! + if dpkg --compare-versions "$2" lt-nl "8.63.dfsg.1-1"; then + update-alternatives --remove-all gs || true + update-alternatives --remove-all gs.1 || true + fi + + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- ghostscript-8.71.dfsg.1.orig/debian/ghostscript.postrm +++ ghostscript-8.71.dfsg.1/debian/ghostscript.postrm @@ -0,0 +1,44 @@ +#! /bin/sh +# postrm script for ghostscript +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' overwrit>r> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove) + # Remove defoma directory + rm -rf /var/lib/defoma/gs.d + ;; + purge) + # Remove defoma-related files + rm -f /etc/defoma/ghostscript.subst-rule + rm -f /etc/defoma/ghostscript.subst-rule~ + ;; + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 --- ghostscript-8.71.dfsg.1.orig/debian/gs.preinst +++ ghostscript-8.71.dfsg.1/debian/gs.preinst @@ -0,0 +1,45 @@ +#!/bin/sh +# preinst script for gs +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) + # Do away with update-alternative for /usr/bin/gs, we have one + # grand unified Ghostscript now! + if dpkg --compare-versions "$2" lt-nl "8.63.dfsg.1-1"; then + update-alternatives --remove-all gs || true + update-alternatives --remove-all gs.1 || true + fi + + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- ghostscript-8.71.dfsg.1.orig/debian/rules +++ ghostscript-8.71.dfsg.1/debian/rules @@ -0,0 +1,162 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +DEB_AUTO_UPDATE_AUTOCONF=yes + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/autotools.mk +include /usr/share/cdbs/1/rules/dpatch.mk + +# for building w/ FAPI +#FT_CPPFLAGS = $(shell pkg-config --cflags freetype2) +#FT_LDFLAGS=$(shell pkg-config --libs freetype2) +#FT_OPTS := FT_BRIDGE=1 FT_CFLAGS=$(FT_CPPFLAGS) FT_LIB=$(FT_LDFLAGS) + +#ifeq ($(DEB_HOST_ARCH),s390) +# CC=gcc-3.4 +#else +# CC=gcc +#endif + +# Handling DEB_BUILD_OPTIONS +#export DEB_BUILD_OPTIONS=noopt,nostrip +CFLAGS:=$(CFLAGS) -g $(if $(findstring noopt,$(DEB_BUILD_OPTIONS)),-O0,-O2) + +DEB_CONFIGURE_SCRIPT_ENV := CFLAGS="$(CFLAGS) -fPIC" CPPFLAGS="$(FT_CPPFLAGS)" LDFLAGS="-lpaper $(FT_LDFLAGS)" +DEB_CONFIGURE_EXTRA_FLAGS := --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info \ + --with-ijs --with-jbig2dec --with-jasper --with-x --disable-gtk \ + --enable-dynamic --with-omni --enable-cups --disable-compile-inits \ + --disable-cairo --with-drivers=ALL \ + --with-fontpath=/var/lib/defoma/gs.d/dirs/fonts:/usr/share/cups/fonts:/usr/share/ghostscript/fonts:/usr/local/lib/ghostscript/fonts:/usr/share/fonts +DEB_MAKE_BUILD_TARGET := STDDIRS $(FT_OPTS) +DEB_MAKE_INSTALL_TARGET := soinstall install-shared install-cups install-contrib-extras \ + DESTDIR=$(CURDIR)/debian/ghostscript \ + prefix=/usr \ + datadir=/usr/share \ + gsdir=/usr/share/ghostscript \ + docdir=/usr/share/doc/ghostscript \ + exdir=/usr/share/doc/ghostscript/examples \ + CUPSSERVERBIN=/usr/lib/cups \ + CUPSSERVER=/usr/lib/cups \ + CUPSSERVERROOT=/etc/cups \ + CUPSDATA=/usr/share/ppd/ghostscript + +fail-if-cmaps-exist: + @test ! -d Resource/CMap || ( \ + echo; \ + echo 'ERROR: Source contains CMaps that are declared non-free.'; \ + echo ' Please strip Resource/CMap from source!'; \ + exit 1) + +clean:: + -cd jasper && $(MAKE) distclean + [ ! -f Makefile ] || $(MAKE) soclean + [ ! -f Makefile ] || $(MAKE) distclean + # These are somehow left... + -rm -rf sobin soobj cups/pstopxl cups/pstoraster + +build/ghostscript:: + #/usr/bin/docbook-to-man debian/ghostscript.sgml > ghostscript.1 + $(MAKE) cups + +build/ghostscript-x:: + $(MAKE) obj/X11.so + +build/libgs8:: + $(MAKE) so + +install/ghostscript:: + # Move *.types and *.convs files from /etc/cups to + # /usr/share/cups/mime, so that they are not considered conffiles + mkdir -p $(CURDIR)/debian/ghostscript/usr/share/cups/mime/ + mv $(CURDIR)/debian/ghostscript/etc/cups/*.types \ + $(CURDIR)/debian/ghostscript/usr/share/cups/mime/ 2> /dev/null || : + mv $(CURDIR)/debian/ghostscript/etc/cups/*.convs \ + $(CURDIR)/debian/ghostscript/usr/share/cups/mime/ 2> /dev/null || : + rmdir --ignore-fail-on-non-empty $(CURDIR)/debian/ghostscript/etc/cups + rmdir --ignore-fail-on-non-empty $(CURDIR)/debian/ghostscript/etc + + # Install Defoma script + install -m 644 $(CURDIR)/debian/gs.defoma $(CURDIR)/debian/ghostscript/usr/share/defoma/scripts + + # Remove some of the scripts + rm $(CURDIR)/debian/ghostscript/usr/bin/unix-lpr.sh $(CURDIR)/debian/ghostscript/usr/bin/lprsetup.sh $(CURDIR)/debian/ghostscript/usr/bin/pv.sh $(CURDIR)/debian/ghostscript/usr/bin/fixmswrd.pl + + # Remove ps2pdf, we use update-alternatives for that + rm $(CURDIR)/debian/ghostscript/usr/bin/ps2pdf + + # Do not include the Ghostscript loader executable with GTK support + rm -f $(CURDIR)/debian/ghostscript/usr/bin/gsx + + # Do not include the shipped Fontmaps, since Fontmaps will be + # automatically generated by Defoma. + # You may find them in /var/lib/defoma/gs.d/dirs/fonts/ + GSVERSION=`ls -1 $(CURDIR)/debian/ghostscript/usr/share/ghostscript/ | head -1`; \ + rm -f $(CURDIR)/debian/ghostscript/usr/share/ghostscript/$$GSVERSION/Resource/Init/Fontmap*; \ + rm -f $(CURDIR)/debian/ghostscript/usr/share/ghostscript/$$GSVERSION/Resource/Init/cidfmap + + # Rename /usr/bin/gsc, to not conflict with gambc + mv $(CURDIR)/debian/ghostscript/usr/bin/gsc $(CURDIR)/debian/ghostscript/usr/bin/gs + + # Some convenience links + ln -s /usr/bin/gs $(CURDIR)/debian/ghostscript/usr/bin/ghostscript + ln -s /usr/share/man/man1/gs.1 $(CURDIR)/debian/ghostscript/usr/share/man/man1/ghostscript.1 + + # Remove C headers, they go into the libgs-dev package + rm -rf $(CURDIR)/debian/ghostscript/usr/include + + # Install Apport hook + install -D -m 644 debian/local/apport-hook.py $(CURDIR)/debian/ghostscript/usr/share/apport/package-hooks/source_ghostscript.py + +install/ghostscript-cups:: + # Separate everything which is for CUPS into the ghostscript-cups + # package + mkdir -p $(CURDIR)/debian/ghostscript-cups/usr/share/ + mv $(CURDIR)/debian/ghostscript/usr/share/cups $(CURDIR)/debian/ghostscript-cups/usr/share/ + mv $(CURDIR)/debian/ghostscript/usr/share/ppd $(CURDIR)/debian/ghostscript-cups/usr/share/ + mkdir -p $(CURDIR)/debian/ghostscript-cups/usr/lib/ + mv $(CURDIR)/debian/ghostscript/usr/lib/cups $(CURDIR)/debian/ghostscript-cups/usr/lib/ + +install/ghostscript-x:: + # Separate the dynamic library for X support into the ghostscript-x + # package + mkdir -p $(CURDIR)/debian/ghostscript-x/usr/lib/ + mv $(CURDIR)/debian/ghostscript/usr/lib/ghostscript $(CURDIR)/debian/ghostscript-x/usr/lib/ + +install/ghostscript-doc:: + # Move documentation into the ghostscript-doc package + mkdir -p $(CURDIR)/debian/ghostscript-doc/usr/share/ + mv $(CURDIR)/debian/ghostscript/usr/share/doc $(CURDIR)/debian/ghostscript-doc/usr/share/ + +binary-post-install/ghostscript:: + # for non-arch-all builds, we need to remove the + # documentation and the fonts manually, since + # install/ghostscript-doc is not called + # for them + rm -f $(CURDIR)/debian/ghostscript/usr/share/doc/ghostscript/*.htm + rm -f $(CURDIR)/debian/ghostscript/usr/share/doc/ghostscript/*.html + rm -f $(CURDIR)/debian/ghostscript/usr/share/doc/ghostscript/*.css + rm -f $(CURDIR)/debian/ghostscript/usr/share/doc/ghostscript/README + rm -rf $(CURDIR)/debian/ghostscript/usr/share/doc/ghostscript/examples + GSVERSION=`ls -1 $(CURDIR)/debian/ghostscript/usr/share/ghostscript/ | head -1`; \ + for font in $(CURDIR)/debian/ghostscript/usr/share/ghostscript/$$GSVERSION/Resource/Font/*; do \ + file="$$(basename $$font)"; \ + [ "$$file" = "Dingbats" ] || [ "$$file" = "StandardSymL" ] \ + || rm $$font; \ + done + +install/libgs8:: + # Move libgs into the libgs8 package + mkdir -p $(CURDIR)/debian/libgs8/usr/lib/ + rm -f $(CURDIR)/debian/ghostscript/usr/lib/libgs* + cp sobin/libgs.so.8.* $(CURDIR)/debian/libgs8/usr/lib/ + cp -P sobin/libgs.so.8 $(CURDIR)/debian/libgs8/usr/lib/ + + # Move libgs.so link into the libgs-dev package + # and install also the C headers there + mkdir -p $(CURDIR)/debian/libgs-dev/usr/lib/ + cp -P sobin/libgs.so $(CURDIR)/debian/libgs-dev/usr/lib/ + mkdir -p $(CURDIR)/debian/libgs-dev/usr/include/ghostscript + install -m 644 $(CURDIR)/psi/iapi.h $(CURDIR)/debian/libgs-dev/usr/include/ghostscript + install -m 644 $(CURDIR)/psi/ierrors.h $(CURDIR)/debian/libgs-dev/usr/include/ghostscript + install -m 644 $(CURDIR)/base/gdevdsp.h $(CURDIR)/debian/libgs-dev/usr/include/ghostscript --- ghostscript-8.71.dfsg.1.orig/debian/ghostscript-doc.doc-base +++ ghostscript-8.71.dfsg.1/debian/ghostscript-doc.doc-base @@ -0,0 +1,10 @@ +Document: ghostscript +Title: GPL Ghostscript Manual +Author: artofcode LLC. +Abstract: This manual describes what GPL Ghostscript is + and how it can be used +Section: Text + +Format: HTML +Index: /usr/share/doc/ghostscript/index.html +Files: /usr/share/doc/ghostscript/*.htm* --- ghostscript-8.71.dfsg.1.orig/debian/local/apport-hook.py +++ ghostscript-8.71.dfsg.1/debian/local/apport-hook.py @@ -0,0 +1,11 @@ +'''apport package hook for ghostscript + +(c) 2009 Canonical Ltd. +Author: Brian Murray +''' + +from apport.hookutils import * + +def add_info(report): + attach_hardware(report) + attach_printing(report) --- ghostscript-8.71.dfsg.1.orig/debian/patches/ps2pdf-hyperlinks.dpatch +++ ghostscript-8.71.dfsg.1/debian/patches/ps2pdf-hyperlinks.dpatch @@ -0,0 +1,55 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## ps2pdf-hyperlinks.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.2~/base/gdevpdfm.c ghostscript-8.71.dfsg.2/base/gdevpdfm.c +--- ghostscript-8.71.dfsg.2~/base/gdevpdfm.c 2009-10-06 09:33:33.000000000 +0200 ++++ ghostscript-8.71.dfsg.2/base/gdevpdfm.c 2010-07-19 18:57:12.914899588 +0200 +@@ -125,7 +125,7 @@ + static int + pdfmark_make_dest(char dstr[MAX_DEST_STRING], gx_device_pdf * pdev, + const char *Page_key, const char *View_key, +- const gs_param_string * pairs, uint count) ++ const gs_param_string * pairs, uint count, uint RequirePage) + { + gs_param_string page_string, view_string; + int present = +@@ -135,7 +135,7 @@ + gs_param_string action; + int len; + +- if (present) ++ if (present || RequirePage) + page = pdfmark_page_number(pdev, &page_string); + if (view_string.size == 0) + param_string_from_string(view_string, "[/XYZ null null null]"); +@@ -485,7 +485,7 @@ + /* Make a destination even if this is for an outline. */ + if (Dest.data == 0) { + code = pdfmark_make_dest(dest, params->pdev, "/Page", "/View", +- pairs, count); ++ pairs, count, 0); + if (code < 0) + return code; + param_string_from_string(Dest, dest); +@@ -1100,7 +1100,7 @@ + + if (!pdfmark_find_key("/Dest", pairs, count, &key) || + (present = +- pdfmark_make_dest(dest, pdev, "/Page", "/View", pairs, count)) < 0 ++ pdfmark_make_dest(dest, pdev, "/Page", "/View", pairs, count, 1)) < 0 + ) + return_error(gs_error_rangecheck); + cos_string_value(&value, (byte *)dest, strlen(dest)); +@@ -1523,7 +1523,7 @@ + + if (count & 1) + return_error(gs_error_rangecheck); +- if (pdfmark_make_dest(dest, pdev, "/Page", "/View", pairs, count)) { ++ if (pdfmark_make_dest(dest, pdev, "/Page", "/View", pairs, count, 0)) { + int i; + + code = cos_dict_put_c_key_string(pdev->Catalog, "/OpenAction", --- ghostscript-8.71.dfsg.1.orig/debian/patches/pdftoraster-wait-for-ghostscript.dpatch +++ ghostscript-8.71.dfsg.1/debian/patches/pdftoraster-wait-for-ghostscript.dpatch @@ -0,0 +1,46 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## pdftoraster-wait-for-ghostscript.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad ghostscript-8.71.dfsg.1~/cups/pdftoraster.c ghostscript-8.71.dfsg.1/cups/pdftoraster.c +--- ghostscript-8.71.dfsg.1~/cups/pdftoraster.c 2008-10-18 00:58:21.000000000 +0200 ++++ ghostscript-8.71.dfsg.1/cups/pdftoraster.c 2010-03-09 20:44:15.875277721 +0100 +@@ -35,6 +35,8 @@ + #include + #include + #include ++#include ++#include + + #define MAX_CHECK_COMMENT_LINES 20 + #ifndef GS +@@ -123,6 +125,7 @@ + const char* apos; + int fds[2]; + int pid; ++ int status; + + parseOpts(argc, argv); + +@@ -502,8 +505,17 @@ + } + } + fclose(fp); ++ close (fds[1]); + } + +- exit(0); ++ if (waitpid (pid, &status, 0) == -1) { ++ perror (GS); ++ exit (1); ++ } ++ ++ if (WIFEXITED (status)) ++ exit(WEXITSTATUS (status)); ++ else ++ exit(1); + } + --- ghostscript-8.71.dfsg.1.orig/debian/patches/CVE-2011-451x.dpatch +++ ghostscript-8.71.dfsg.1/debian/patches/CVE-2011-451x.dpatch @@ -0,0 +1,29 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +# Description: fix denial of service and possible code execution via +# heap-based buffer overflows. +# Origin: Patch thanks to Red Hat + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_cs.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_cs.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_cs.c 2011-12-20 15:44:05.074308373 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_cs.c 2011-12-20 15:44:13.946308651 -0500 +@@ -750,6 +750,10 @@ + return -1; + } + compparms->numrlvls = compparms->numdlvls + 1; ++ if (compparms->numrlvls > JPC_MAXRLVLS) { ++ jpc_cox_destroycompparms(compparms); ++ return -1; ++ } + if (prtflag) { + for (i = 0; i < compparms->numrlvls; ++i) { + if (jpc_getuint8(in, &tmp)) { +@@ -1340,7 +1344,7 @@ + jpc_crgcomp_t *comp; + uint_fast16_t compno; + crg->numcomps = cstate->numcomps; +- if (!(crg->comps = jas_alloc2(cstate->numcomps, sizeof(uint_fast16_t)))) { ++ if (!(crg->comps = jas_alloc2(cstate->numcomps, sizeof(jpc_crgcomp_t)))) { + return -1; + } + for (compno = 0, comp = crg->comps; compno < cstate->numcomps; --- ghostscript-8.71.dfsg.1.orig/debian/patches/no-cant-refill-scanner-input-buffer-error.dpatch +++ ghostscript-8.71.dfsg.1/debian/patches/no-cant-refill-scanner-input-buffer-error.dpatch @@ -0,0 +1,57 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## no-cant-refill-scanner-input-buffer-error.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad ghostscript-8.71.dfsg.1~/base/seexec.c ghostscript-8.71.dfsg.1/base/seexec.c +--- ghostscript-8.71.dfsg.1~/base/seexec.c 2009-08-14 06:12:58.000000000 +0200 ++++ ghostscript-8.71.dfsg.1/base/seexec.c 2010-02-24 10:02:20.295231460 +0100 +@@ -165,7 +165,11 @@ + r.limit = r.ptr + ss->hex_left; + status = s_hex_process(&r, pw, &ss->odd, + (ss->is_leading_space ? hex_ignore_leading_whitespace : hex_break_on_whitespace)); +- ss->is_leading_space = (status == 2); ++ if (status == 2) { ++ ss->is_leading_space = true; ++ status = 1; ++ } else ++ ss->is_leading_space = false; + pr->ptr = r.ptr; + ss->hex_left -= r.ptr - start; + /* +diff -urNad ghostscript-8.71.dfsg.1~/base/sstring.c ghostscript-8.71.dfsg.1/base/sstring.c +--- ghostscript-8.71.dfsg.1~/base/sstring.c 2009-08-13 21:04:34.000000000 +0200 ++++ ghostscript-8.71.dfsg.1/base/sstring.c 2010-02-24 10:02:20.295231460 +0100 +@@ -355,8 +355,12 @@ + /* ------ Utilities ------ */ + + /* +- * Convert hex data to binary. Return 1 if we filled the string, 0 if +- * we ran out of input data before filling the string, or ERRC on error. ++ * Convert hex data to binary. ++ * Return 1 if we filled the string, ++ * 0 if we ran out of input data before filling the string, ++ * 2 if hex_break_on_whitespace is on and we encounrered ++ * a white space. ++ * ERRC on error. + * The caller must set *odd_digit to -1 before the first call; + * after each call, if an odd number of hex digits has been read (total), + * *odd_digit is the odd digit value, otherwise *odd_digit = -1. +diff -urNad ghostscript-8.71.dfsg.1~/psi/iscan.c ghostscript-8.71.dfsg.1/psi/iscan.c +--- ghostscript-8.71.dfsg.1~/psi/iscan.c 2009-11-11 14:52:23.000000000 +0100 ++++ ghostscript-8.71.dfsg.1/psi/iscan.c 2010-02-24 10:02:20.295231460 +0100 +@@ -329,9 +329,9 @@ + rstate, 1, cont); + } + } +- /* No more data available, but no exception. How can this be? */ +- lprintf("Can't refill scanner input buffer!"); +- return_error(e_Fatal); ++ /* No more data available, but no exception. */ ++ /* A filter is consuming headers but returns nothing. */ ++ return 0; + } + + /* --- ghostscript-8.71.dfsg.1.orig/debian/patches/02_gs-man-fix-for-debian.dpatch +++ ghostscript-8.71.dfsg.1/debian/patches/02_gs-man-fix-for-debian.dpatch @@ -0,0 +1,44 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 02_gs-man-fix-for-debian.dpatch by Masayuki Hatta (mhatta) +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad ghostscript-8.64.dfsg.1~svn9323~/man/gs.1 ghostscript-8.64.dfsg.1~svn9323/man/gs.1 +--- ghostscript-8.64.dfsg.1~svn9323~/man/gs.1 2009-01-05 19:08:07.000000000 +0900 ++++ ghostscript-8.64.dfsg.1~svn9323/man/gs.1 2009-01-05 19:50:58.000000000 +0900 +@@ -295,18 +295,18 @@ + are typically based in \fBC:\\GS\fR, but may be elsewhere, especially if + you install Ghostscript with \fBGSview\fR. Run "\fBgs -h\fR" to find the + location of Ghostscript documentation on your system, from which you can +-get more details. ++get more details. On a Debian system they are in \fB/usr\fR. + .TP +-.B /usr/local/share/ghostscript/#.##/* ++.B /usr/share/ghostscript/#.##/* + Startup files, utilities, and basic font definitions + .TP +-.B /usr/local/share/ghostscript/fonts/* ++.B /usr/share/fonts/type1/gsfonts/* + More font definitions + .TP +-.B /usr/local/share/ghostscript/#.##/examples/* ++.B /usr/share/doc/ghostscript/examples/* + Ghostscript demonstration files + .TP +-.B /usr/local/share/ghostscript/#.##/doc/* ++.B /usr/share/doc/ghostscript/* + Diverse document files + .SH "INITIALIZATION FILES" + When looking for the initialization files "gs_*.ps", the files related to +@@ -330,7 +330,8 @@ + Ghostscript makefile when the executable was built. When \fBgs\fR is built + on Unix, \fBGS_LIB_DEFAULT\fR is usually + "/usr/local/share/ghostscript/#.##:/usr/local/share/ghostscript/fonts" +-where "#.##" represents the Ghostscript version number. ++where "#.##" represents the Ghostscript version number. They are ++"/usr/share/ghostscript/#.##" on a Debian system. + .PP + Each of these (\fBGS_LIB_DEFAULT\fR, \fBGS_LIB\fR, and \fB\-I\fR parameter) + may be either a single directory or a list of directories separated by --- ghostscript-8.71.dfsg.1.orig/debian/patches/fix-broken-korean-example.dpatch +++ ghostscript-8.71.dfsg.1/debian/patches/fix-broken-korean-example.dpatch @@ -0,0 +1,36 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## fix-broken-korean-example.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad ghostscript-8.71.dfsg.1~/examples/cjk/gscjk_ak.ps ghostscript-8.71.dfsg.1/examples/cjk/gscjk_ak.ps +--- ghostscript-8.71.dfsg.1~/examples/cjk/gscjk_ak.ps 2009-01-05 15:02:04.000000000 +0100 ++++ ghostscript-8.71.dfsg.1/examples/cjk/gscjk_ak.ps 2010-03-09 17:54:07.945232153 +0100 +@@ -77,10 +77,10 @@ + %%EndProlog + /HYSMyeongJo-Medium--KSC-EUC-V *findfont 25 scalefont setfont + 500 625 moveto +-(ѱ ξ μ) show ++( ѱ ξ μ) show + /HYSMyeongJo-Medium--KSC-EUC-H *findfont 25 scalefont setfont + 50 600 moveto +-(Ghostscript) show ++( Ghostscript) show + 50 550 moveto + (ѱ Korean) show + 50 500 moveto +@@ -100,10 +100,10 @@ + (MyeongJo Typeface ) show + /HYGoThic-Medium--KSC-EUC-H *findfont 20 scalefont setfont + 150 375 moveto +-(Gothic Typeface  show ++(Gothic Typeface ) show + /HYRGoThic-Medium--KSC-EUC-H *findfont 20 scalefont setfont + 150 350 moveto +-(Rounded Gothic Typeface ձٰ show ++(Rounded Gothic Typeface ձٰ) show + % + /Times-Roman findfont 13 scalefont setfont + 50 200 moveto --- ghostscript-8.71.dfsg.1.orig/debian/patches/CVE-2014-9029.dpatch +++ ghostscript-8.71.dfsg.1/debian/patches/CVE-2014-9029.dpatch @@ -0,0 +1,38 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +# Description: fix heap overflows via crafted jp2 file +# Origin: vendor, https://bugzilla.redhat.com/attachment.cgi?id=961994&action=diff +# Bug-Debian: https://bugs.debian.org/772036 +# Bug-RedHat: https://bugzilla.redhat.com/show_bug.cgi?id=1167537 +# Author: Tomas Hoger + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_dec.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_dec.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_dec.c 2014-12-05 15:45:59.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_dec.c 2014-12-05 15:47:13.214854754 -0500 +@@ -1295,7 +1295,7 @@ + jpc_coc_t *coc = &ms->parms.coc; + jpc_dec_tile_t *tile; + +- if (JAS_CAST(int, coc->compno) > dec->numcomps) { ++ if (JAS_CAST(int, coc->compno) >= dec->numcomps) { + jas_eprintf( + "invalid component number in COC marker segment\n"); + return -1; +@@ -1322,7 +1322,7 @@ + jpc_rgn_t *rgn = &ms->parms.rgn; + jpc_dec_tile_t *tile; + +- if (JAS_CAST(int, rgn->compno) > dec->numcomps) { ++ if (JAS_CAST(int, rgn->compno) >= dec->numcomps) { + jas_eprintf( + "invalid component number in RGN marker segment\n"); + return -1; +@@ -1372,7 +1372,7 @@ + jpc_qcc_t *qcc = &ms->parms.qcc; + jpc_dec_tile_t *tile; + +- if (JAS_CAST(int, qcc->compno) > dec->numcomps) { ++ if (JAS_CAST(int, qcc->compno) >= dec->numcomps) { + jas_eprintf( + "invalid component number in QCC marker segment\n"); + return -1; --- ghostscript-8.71.dfsg.1.orig/debian/patches/fix-build-of-executables.dpatch +++ ghostscript-8.71.dfsg.1/debian/patches/fix-build-of-executables.dpatch @@ -0,0 +1,24 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## fix-build-of-executables.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad ghostscript-8.71.dfsg.1~/base/unix-dll.mak ghostscript-8.71.dfsg.1/base/unix-dll.mak +--- ghostscript-8.71.dfsg.1~/base/unix-dll.mak 2009-10-19 22:24:53.000000000 +0200 ++++ ghostscript-8.71.dfsg.1/base/unix-dll.mak 2010-02-11 14:32:23.005292769 +0100 +@@ -80,11 +80,11 @@ + + $(GSSOC_XE): $(GS_SO) $(PSSRC)$(SOC_LOADER) + $(GLCC) -g -o $(GSSOC_XE) $(PSSRC)dxmainc.c \ +- $(LDFLAGS) -L$(BINDIR) -l$(GS) ++ -L$(BINDIR) -l$(GS) + + $(GSSOX_XE): $(GS_SO) $(PSSRC)$(SOC_LOADER) + $(GLCC) -g $(SOC_CFLAGS) -o $(GSSOX_XE) $(PSSRC)$(SOC_LOADER) \ +- $(LDFLAGS) -L$(BINDIR) -l$(GS) $(SOC_LIBS) ++ -L$(BINDIR) -l$(GS) $(SOC_LIBS) + + # ------------------------- Recursive make targets ------------------------- # + --- ghostscript-8.71.dfsg.1.orig/debian/patches/01_docdir-fix-for-debian.dpatch +++ ghostscript-8.71.dfsg.1/debian/patches/01_docdir-fix-for-debian.dpatch @@ -0,0 +1,21 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 01_docdir-fix-for-debian.dpatch by Masayuki Hatta (mhatta) +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Set docdir appropriately for Debian. + +@DPATCH@ +diff -urNad ghostscript-8.64.dfsg.1~svn9323~/base/Makefile.in ghostscript-8.64.dfsg.1~svn9323/base/Makefile.in +--- ghostscript-8.64.dfsg.1~svn9323~/base/Makefile.in 2009-01-05 19:08:07.000000000 +0900 ++++ ghostscript-8.64.dfsg.1~svn9323/base/Makefile.in 2009-01-05 19:43:07.000000000 +0900 +@@ -71,8 +71,8 @@ + gssharedir = @libdir@/ghostscript/$(GS_DOT_VERSION) + gsincludedir = @includedir@/ghostscript/ + +-docdir=$(gsdatadir)/doc +-exdir=$(gsdatadir)/examples ++docdir=$(prefix)/share/doc/ghostscript ++exdir=$(prefix)/share/doc/ghostscript/examples + GS_DOCDIR=$(docdir) + + # Define install location for 'cups' device/filter support --- ghostscript-8.71.dfsg.1.orig/debian/patches/cups-raster-fixes.dpatch +++ ghostscript-8.71.dfsg.1/debian/patches/cups-raster-fixes.dpatch @@ -0,0 +1,1798 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## cups-raster-fixes.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad ghostscript-8.71.dfsg.1~/base/gsalloc.c ghostscript-8.71.dfsg.1/base/gsalloc.c +--- ghostscript-8.71.dfsg.1~/base/gsalloc.c 2009-11-30 21:34:48.000000000 +0100 ++++ ghostscript-8.71.dfsg.1/base/gsalloc.c 2010-04-29 09:00:50.359834468 +0200 +@@ -61,7 +61,7 @@ + static bool + alloc_size_is_ok(gs_memory_type_ptr_t stype) + { +- return (stype->ssize > 0 && stype->ssize < 0x100000); ++ return (stype->ssize > 0 && stype->ssize < 0x200000); + } + # define ALLOC_CHECK_SIZE(stype)\ + BEGIN\ +diff -urNad ghostscript-8.71.dfsg.1~/cups/gdevcups.c ghostscript-8.71.dfsg.1/cups/gdevcups.c +--- ghostscript-8.71.dfsg.1~/cups/gdevcups.c 2010-01-22 18:46:02.000000000 +0100 ++++ ghostscript-8.71.dfsg.1/cups/gdevcups.c 2010-04-29 09:00:21.669807620 +0200 +@@ -1,5 +1,5 @@ + /* +- * "$Id: gdevcups.c 10631 2010-01-22 17:46:02Z till $" ++ * "$Id: gdevcups.c 11149 2010-04-28 22:37:01Z till $" + * + * GNU Ghostscript raster output driver for the Common UNIX Printing + * System (CUPS). +@@ -34,6 +34,8 @@ + * cups_close() - Close the output file. + * cups_decode_color() - Decode a color value. + * cups_encode_color() - Encode a color value. ++ * cups_get_color_comp_index() ++ * - Color component to index + * cups_get_color_mapping_procs() + * - Get the list of color mapping procedures. + * cups_get_matrix() - Generate the default page matrix. +@@ -66,7 +68,6 @@ + #include "std.h" /* to stop stdlib.h redefining types */ + #include "gdevprn.h" + #include "gsparam.h" +-#include "gsexit.h" + #include "arch.h" + + #include +@@ -95,16 +96,6 @@ + + + /* +- * Newer versions of Ghostscript don't provide gs_exit() function anymore. +- * It has been renamed to gs_to_exit()... +- */ +- +-#ifdef dev_t_proc_encode_color +-# define gs_exit gs_to_exit +-#endif /* dev_t_proc_encode_color */ +- +- +-/* + * CIE XYZ color constants... + */ + +@@ -177,6 +168,7 @@ + private cm_map_proc_cmyk(cups_map_cmyk); + private dev_proc_decode_color(cups_decode_color); + private dev_proc_encode_color(cups_encode_color); ++private dev_proc_get_color_comp_index(cups_get_color_comp_index); + private dev_proc_get_color_mapping_procs(cups_get_color_mapping_procs); + + static const gx_cm_color_map_procs cups_color_mapping_procs = +@@ -204,6 +196,24 @@ + cups_raster_t *stream; /* Raster stream */ + cups_page_header_t header; /* PostScript page device info */ + int landscape; /* Non-zero if this is landscape */ ++ int lastpage; ++ int HaveProfile; /* Has a color profile been defined? */ ++ char *Profile; /* Current simple color profile string */ ++ ppd_file_t *PPD; /* PPD file for this device */ ++ unsigned char RevLower1[16]; /* Lower 1-bit reversal table */ ++ unsigned char RevUpper1[16]; /* Upper 1-bit reversal table */ ++ unsigned char RevLower2[16]; /* Lower 2-bit reversal table */ ++ unsigned char RevUpper2[16]; /* Upper 2-bit reversal table */ ++#ifdef GX_COLOR_INDEX_TYPE ++ gx_color_value DecodeLUT[65536];/* Output color to RGB value LUT */ ++#else ++ gx_color_value DecodeLUT[256]; /* Output color to RGB value LUT */ ++#endif /* GX_COLOR_INDEX_TYPE */ ++ unsigned short EncodeLUT[gx_max_color_value + 1];/* RGB value to output color LUT */ ++ int Density[CUPS_MAX_VALUE + 1];/* Density LUT */ ++ int Matrix[3][3][CUPS_MAX_VALUE + 1];/* Color transform matrix LUT */ ++ ++ /* Used by cups_put_params(): */ + } gx_device_cups; + + private gx_device_procs cups_procs = +@@ -268,7 +278,7 @@ + NULL, /* discard_transparency_layer */ + #ifdef dev_t_proc_encode_color + cups_get_color_mapping_procs, +- gx_error_get_color_comp_index, /* Dummy to avoid segfault */ ++ cups_get_color_comp_index, + cups_encode_color, + cups_decode_color, + #else +@@ -285,7 +295,9 @@ + NULL, /* fill_linear_color_triangle */ + NULL, /* update_spot_equivalent_colors */ + NULL, /* ret_devn_params */ +- NULL /* fillpage */ ++ NULL, /* fillpage */ ++ NULL, /* push_transparency_state */ ++ NULL /* pop_transparency_state */ + }; + + #define prn_device_body_copies(dtype, procs, dname, w10, h10, xdpi, ydpi, lo, to, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_pages)\ +@@ -381,63 +393,35 @@ + "" /* cupsPageSizeName */ + #endif /* CUPS_RASTER_SYNCv1 */ + }, +- 0 /* landscape */ ++ 0, /* landscape */ ++ 0, /* lastpage */ ++ 0, /* HaveProfile */ ++ NULL, /* Profile */ ++ NULL, /* PPD */ ++ { 0x00, 0x08, 0x04, 0x0c, 0x02, 0x0a, 0x06, 0x0e, ++ 0x01, 0x09, 0x05, 0x0d, 0x03, 0x0b, 0x07, 0x0f },/* RevLower1 */ ++ { 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, ++ 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0 },/* RevUpper1 */ ++ { 0x00, 0x04, 0x08, 0x0c, 0x01, 0x05, 0x09, 0x0d, ++ 0x02, 0x06, 0x0a, 0x0e, 0x03, 0x07, 0x0b, 0x0f },/* RevLower2 */ ++ { 0x00, 0x40, 0x80, 0xc0, 0x10, 0x50, 0x90, 0xd0, ++ 0x20, 0x60, 0xa0, 0xe0, 0x30, 0x70, 0xb0, 0xf0 },/* RevUpper2 */ ++ { }, /* DecodeLUT */ ++ { }, /* EncodeLUT */ ++ { }, /* Density */ ++ { } /* Matrix */ + }; + + /* +- * Globals... +- */ +- +-#ifdef GX_COLOR_INDEX_TYPE +-static gx_color_value cupsDecodeLUT[65536]; +- /* Output color to RGB value LUT */ +-#else +-static gx_color_value cupsDecodeLUT[256]; +- /* Output color to RGB value LUT */ +-#endif /* GX_COLOR_INDEX_TYPE */ +-static unsigned short cupsEncodeLUT[gx_max_color_value + 1]; +- /* RGB value to output color LUT */ +- +-static ppd_file_t *cupsPPD = 0; /* PPD file for this device */ +-static char *cupsProfile = NULL; +- /* Current simple color profile string */ +-static int cupsHaveProfile = 0; +- /* Has a color profile been defined? */ +-static int cupsMatrix[3][3][CUPS_MAX_VALUE + 1]; +- /* Color transform matrix LUT */ +-static int cupsDensity[CUPS_MAX_VALUE + 1]; +- /* Density LUT */ +-static unsigned char cupsRevLower1[16] = +- { /* Lower 1-bit reversal table */ +- 0x00, 0x08, 0x04, 0x0c, 0x02, 0x0a, 0x06, 0x0e, +- 0x01, 0x09, 0x05, 0x0d, 0x03, 0x0b, 0x07, 0x0f +- }, +- cupsRevUpper1[16] = +- { /* Upper 1-bit reversal table */ +- 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, +- 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0 +- }, +- cupsRevLower2[16] = +- { /* Lower 2-bit reversal table */ +- 0x00, 0x04, 0x08, 0x0c, 0x01, 0x05, 0x09, 0x0d, +- 0x02, 0x06, 0x0a, 0x0e, 0x03, 0x07, 0x0b, 0x0f +- }, +- cupsRevUpper2[16] = +- { /* Upper 2-bit reversal table */ +- 0x00, 0x40, 0x80, 0xc0, 0x10, 0x50, 0x90, 0xd0, +- 0x20, 0x60, 0xa0, 0xe0, 0x30, 0x70, 0xb0, 0xf0 +- }; +- +-/* + * Local functions... + */ + + static double cups_map_cielab(double, double); +-static void cups_print_chunked(gx_device_printer *, unsigned char *, ++static int cups_print_chunked(gx_device_printer *, unsigned char *, + unsigned char *, int); +-static void cups_print_banded(gx_device_printer *, unsigned char *, ++static int cups_print_banded(gx_device_printer *, unsigned char *, + unsigned char *, int); +-static void cups_print_planar(gx_device_printer *, unsigned char *, ++static int cups_print_planar(gx_device_printer *, unsigned char *, + unsigned char *, int); + + /*static void cups_set_margins(gx_device *);*/ +@@ -459,16 +443,16 @@ + } + + #if 0 /* Can't do this here because put_params() might close the device */ +- if (cupsPPD != NULL) ++ if (cups->PPD != NULL) + { +- ppdClose(cupsPPD); +- cupsPPD = NULL; ++ ppdClose(cups->PPD); ++ cups->PPD = NULL; + } + +- if (cupsProfile != NULL) ++ if (cups->Profile != NULL) + { +- free(cupsProfile); +- cupsProfile = NULL; ++ free(cups->Profile); ++ cups->Profile = NULL; + } + #endif /* 0 */ + +@@ -509,9 +493,9 @@ + mask = (1 << shift) - 1; + + for (i = cups->color_info.num_components - 1; i > 0; i --, ci >>= shift) +- cv[i] = cupsDecodeLUT[ci & mask]; ++ cv[i] = cups->DecodeLUT[ci & mask]; + +- cv[0] = cupsDecodeLUT[ci & mask]; ++ cv[0] = cups->DecodeLUT[ci & mask]; + } + + return (0); +@@ -539,10 +523,10 @@ + + shift = cups->header.cupsBitsPerColor; + +- for (ci = cupsEncodeLUT[cv[0]], i = 1; ++ for (ci = cups->EncodeLUT[cv[0]], i = 1; + i < cups->color_info.num_components; + i ++) +- ci = (ci << shift) | cupsEncodeLUT[cv[i]]; ++ ci = (ci << shift) | cups->EncodeLUT[cv[i]]; + + #ifdef DEBUG + dprintf2("DEBUG2: cv[0]=%d -> %llx\n", cv[0], ci); +@@ -583,6 +567,145 @@ + return (ci); + } + ++/* ++ * 'cups_get_color_comp_index()' - Color component to index ++ */ ++ ++#define compare_color_names(pname, name_size, name_str) \ ++ (name_size == (int)strlen(name_str) && strncasecmp(pname, name_str, name_size) == 0) ++ ++int /* O - Index of the named color in ++ the color space */ ++cups_get_color_comp_index(gx_device * pdev, const char * pname, ++ int name_size, int component_type) ++{ ++ switch (cups->header.cupsColorSpace) ++ { ++ case CUPS_CSPACE_K : ++ if (compare_color_names(pname, name_size, "Black") || ++ compare_color_names(pname, name_size, "Gray") || ++ compare_color_names(pname, name_size, "Grey")) ++ return 0; ++ else ++ return -1; /* Indicate that the component name is "unknown" */ ++ break; ++ case CUPS_CSPACE_W : ++ case CUPS_CSPACE_WHITE : ++ if (compare_color_names(pname, name_size, "White") || ++ compare_color_names(pname, name_size, "Luminance") || ++ compare_color_names(pname, name_size, "Gray") || ++ compare_color_names(pname, name_size, "Grey")) ++ return 0; ++ else ++ return -1; ++ break; ++ case CUPS_CSPACE_RGBA : ++ if (compare_color_names(pname, name_size, "Alpha") || ++ compare_color_names(pname, name_size, "Transparent") || ++ compare_color_names(pname, name_size, "Transparency")) ++ return 3; ++ case CUPS_CSPACE_RGBW : ++ if (compare_color_names(pname, name_size, "White")) ++ return 3; ++ case CUPS_CSPACE_RGB : ++ if (compare_color_names(pname, name_size, "Red")) ++ return 0; ++ if (compare_color_names(pname, name_size, "Green")) ++ return 1; ++ if (compare_color_names(pname, name_size, "Blue")) ++ return 2; ++ else ++ return -1; ++ break; ++ case CUPS_CSPACE_CMYK : ++# ifdef CUPS_RASTER_HAVE_COLORIMETRIC ++ case CUPS_CSPACE_CIEXYZ : ++ case CUPS_CSPACE_CIELab : ++ case CUPS_CSPACE_ICC1 : ++ case CUPS_CSPACE_ICC2 : ++ case CUPS_CSPACE_ICC3 : ++ case CUPS_CSPACE_ICC4 : ++ case CUPS_CSPACE_ICC5 : ++ case CUPS_CSPACE_ICC6 : ++ case CUPS_CSPACE_ICC7 : ++ case CUPS_CSPACE_ICC8 : ++ case CUPS_CSPACE_ICC9 : ++ case CUPS_CSPACE_ICCA : ++ case CUPS_CSPACE_ICCB : ++ case CUPS_CSPACE_ICCC : ++ case CUPS_CSPACE_ICCD : ++ case CUPS_CSPACE_ICCE : ++ case CUPS_CSPACE_ICCF : ++# endif /* CUPS_RASTER_HAVE_COLORIMETRIC */ ++ if (compare_color_names(pname, name_size, "Black")) ++ return 3; ++ case CUPS_CSPACE_CMY : ++ if (compare_color_names(pname, name_size, "Cyan")) ++ return 0; ++ if (compare_color_names(pname, name_size, "Magenta")) ++ return 1; ++ if (compare_color_names(pname, name_size, "Yellow")) ++ return 2; ++ else ++ return -1; ++ break; ++ case CUPS_CSPACE_GMCS : ++ if (compare_color_names(pname, name_size, "Silver") || ++ compare_color_names(pname, name_size, "Silver Foil")) ++ return 3; ++ case CUPS_CSPACE_GMCK : ++ if (compare_color_names(pname, name_size, "Gold") || ++ compare_color_names(pname, name_size, "Gold Foil")) ++ return 0; ++ case CUPS_CSPACE_YMCK : ++ if (compare_color_names(pname, name_size, "Black")) ++ return 3; ++ case CUPS_CSPACE_YMC : ++ if (compare_color_names(pname, name_size, "Yellow")) ++ return 0; ++ if (compare_color_names(pname, name_size, "Magenta")) ++ return 1; ++ if (compare_color_names(pname, name_size, "Cyan")) ++ return 2; ++ else ++ return -1; ++ break; ++ case CUPS_CSPACE_KCMYcm : ++ if (compare_color_names(pname, name_size, "Light Cyan") || ++ compare_color_names(pname, name_size, "Photo Cyan")) ++ return 4; ++ if (compare_color_names(pname, name_size, "Light Magenta") || ++ compare_color_names(pname, name_size, "Photo Magenta")) ++ return 5; ++ case CUPS_CSPACE_KCMY : ++ if (compare_color_names(pname, name_size, "Black")) ++ return 0; ++ if (compare_color_names(pname, name_size, "Cyan")) ++ return 1; ++ if (compare_color_names(pname, name_size, "Magenta")) ++ return 2; ++ if (compare_color_names(pname, name_size, "Yellow")) ++ return 3; ++ else ++ return -1; ++ break; ++ case CUPS_CSPACE_GOLD : ++ if (compare_color_names(pname, name_size, "Gold") || ++ compare_color_names(pname, name_size, "Gold Foil")) ++ return 0; ++ else ++ return -1; ++ break; ++ case CUPS_CSPACE_SILVER : ++ if (compare_color_names(pname, name_size, "Silver") || ++ compare_color_names(pname, name_size, "Silver Foil")) ++ return 0; ++ else ++ return -1; ++ break; ++ } ++ return -1; ++} + + /* + * 'cups_get_color_mapping_procs()' - Get the list of color mapping procedures. +@@ -658,8 +781,8 @@ + } + #endif /* CUPS_RASTER_SYNCv1 */ + +- dprintf2("DEBUG2: width = %d, height = %d\n", cups->width, +- cups->height); ++ dprintf2("DEBUG2: width = %d, height = %d\n", cups->header.cupsWidth, ++ cups->header.cupsHeight); + dprintf4("DEBUG2: PageSize = [ %d %d ], HWResolution = [ %d %d ]\n", + cups->header.PageSize[0], cups->header.PageSize[1], + cups->header.HWResolution[0], cups->header.HWResolution[1]); +@@ -937,8 +1060,8 @@ + + dprintf1("DEBUG2: cache_size = %.0f\n", cache_size); + +- space_params->MaxBitmap = (int)cache_size; +- space_params->BufferSpace = (int)cache_size / 10; ++ space_params->MaxBitmap = (long)cache_size; ++ space_params->BufferSpace = (long)cache_size / 10; + } + + +@@ -975,7 +1098,8 @@ + 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 */ +@@ -1000,7 +1124,7 @@ + c0 = 0; + else if (c0 > frac_1) + c0 = frac_1; +- out[0] = frac_1 - (frac)cupsDensity[c0]; ++ out[0] = frac_1 - (frac)cups->Density[c0]; + break; + + case CUPS_CSPACE_RGBA : +@@ -1023,26 +1147,26 @@ + c0 = 0; + else if (c0 > frac_1) + c0 = frac_1; +- out[0] = frac_1 - (frac)cupsDensity[c0]; ++ out[0] = frac_1 - (frac)cups->Density[c0]; + + if (c1 < 0) + c1 = 0; + else if (c1 > frac_1) + c1 = frac_1; +- out[1] = frac_1 - (frac)cupsDensity[c1]; ++ out[1] = frac_1 - (frac)cups->Density[c1]; + + if (c2 < 0) + c2 = 0; + else if (c2 > frac_1) + c2 = frac_1; +- out[2] = frac_1 - (frac)cupsDensity[c2]; ++ out[2] = frac_1 - (frac)cups->Density[c2]; + + if (cups->header.cupsColorSpace == CUPS_CSPACE_RGBW) { + if (c3 < 0) + c3 = 0; + else if (c3 > frac_1) + c3 = frac_1; +- out[3] = frac_1 - (frac)cupsDensity[c3]; ++ out[3] = frac_1 - (frac)cups->Density[c3]; + } + break; + +@@ -1053,9 +1177,9 @@ + if (c0 < 0) + out[0] = 0; + else if (c0 > frac_1) +- out[0] = (frac)cupsDensity[frac_1]; ++ out[0] = (frac)cups->Density[frac_1]; + else +- out[0] = (frac)cupsDensity[c0]; ++ out[0] = (frac)cups->Density[c0]; + break; + + case CUPS_CSPACE_CMY : +@@ -1066,23 +1190,23 @@ + if (c0 < 0) + out[0] = 0; + else if (c0 > frac_1) +- out[0] = (frac)cupsDensity[frac_1]; ++ out[0] = (frac)cups->Density[frac_1]; + else +- out[0] = (frac)cupsDensity[c0]; ++ out[0] = (frac)cups->Density[c0]; + + if (c1 < 0) + out[1] = 0; + else if (c1 > frac_1) +- out[1] = (frac)cupsDensity[frac_1]; ++ out[1] = (frac)cups->Density[frac_1]; + else +- out[1] = (frac)cupsDensity[c1]; ++ out[1] = (frac)cups->Density[c1]; + + if (c2 < 0) + out[2] = 0; + else if (c2 > frac_1) +- out[2] = (frac)cupsDensity[frac_1]; ++ out[2] = (frac)cups->Density[frac_1]; + else +- out[2] = (frac)cupsDensity[c2]; ++ out[2] = (frac)cups->Density[c2]; + break; + + case CUPS_CSPACE_YMC : +@@ -1093,53 +1217,53 @@ + if (c0 < 0) + out[0] = 0; + else if (c0 > frac_1) +- out[0] = (frac)cupsDensity[frac_1]; ++ out[0] = (frac)cups->Density[frac_1]; + else +- out[0] = (frac)cupsDensity[c0]; ++ out[0] = (frac)cups->Density[c0]; + + if (c1 < 0) + out[1] = 0; + else if (c1 > frac_1) +- out[1] = (frac)cupsDensity[frac_1]; ++ out[1] = (frac)cups->Density[frac_1]; + else +- out[1] = (frac)cupsDensity[c1]; ++ out[1] = (frac)cups->Density[c1]; + + if (c2 < 0) + out[2] = 0; + else if (c2 > frac_1) +- out[2] = (frac)cupsDensity[frac_1]; ++ out[2] = (frac)cups->Density[frac_1]; + else +- out[2] = (frac)cupsDensity[c2]; ++ out[2] = (frac)cups->Density[c2]; + break; + + case CUPS_CSPACE_CMYK : + if (c < 0) + out[0] = 0; + else if (c > frac_1) +- out[0] = (frac)cupsDensity[frac_1]; ++ out[0] = (frac)cups->Density[frac_1]; + else +- out[0] = (frac)cupsDensity[c]; ++ out[0] = (frac)cups->Density[c]; + + if (m < 0) + out[1] = 0; + else if (m > frac_1) +- out[1] = (frac)cupsDensity[frac_1]; ++ out[1] = (frac)cups->Density[frac_1]; + else +- out[1] = (frac)cupsDensity[m]; ++ out[1] = (frac)cups->Density[m]; + + if (y < 0) + out[2] = 0; + else if (y > frac_1) +- out[2] = (frac)cupsDensity[frac_1]; ++ out[2] = (frac)cups->Density[frac_1]; + else +- out[2] = (frac)cupsDensity[y]; ++ out[2] = (frac)cups->Density[y]; + + if (k < 0) + out[3] = 0; + else if (k > frac_1) +- out[3] = (frac)cupsDensity[frac_1]; ++ out[3] = (frac)cups->Density[frac_1]; + else +- out[3] = (frac)cupsDensity[k]; ++ out[3] = (frac)cups->Density[k]; + break; + + case CUPS_CSPACE_YMCK : +@@ -1148,30 +1272,30 @@ + if (y < 0) + out[0] = 0; + else if (y > frac_1) +- out[0] = (frac)cupsDensity[frac_1]; ++ out[0] = (frac)cups->Density[frac_1]; + else +- out[0] = (frac)cupsDensity[y]; ++ out[0] = (frac)cups->Density[y]; + + if (m < 0) + out[1] = 0; + else if (m > frac_1) +- out[1] = (frac)cupsDensity[frac_1]; ++ out[1] = (frac)cups->Density[frac_1]; + else +- out[1] = (frac)cupsDensity[m]; ++ out[1] = (frac)cups->Density[m]; + + if (c < 0) + out[2] = 0; + else if (c > frac_1) +- out[2] = (frac)cupsDensity[frac_1]; ++ out[2] = (frac)cups->Density[frac_1]; + else +- out[2] = (frac)cupsDensity[c]; ++ out[2] = (frac)cups->Density[c]; + + if (k < 0) + out[3] = 0; + else if (k > frac_1) +- out[3] = (frac)cupsDensity[frac_1]; ++ out[3] = (frac)cups->Density[frac_1]; + else +- out[3] = (frac)cupsDensity[k]; ++ out[3] = (frac)cups->Density[k]; + break; + + case CUPS_CSPACE_KCMYcm : +@@ -1179,30 +1303,30 @@ + if (k < 0) + out[0] = 0; + else if (k > frac_1) +- out[0] = (frac)cupsDensity[frac_1]; ++ out[0] = (frac)cups->Density[frac_1]; + else +- out[0] = (frac)cupsDensity[k]; ++ out[0] = (frac)cups->Density[k]; + + if (c < 0) + out[1] = 0; + else if (c > frac_1) +- out[1] = (frac)cupsDensity[frac_1]; ++ out[1] = (frac)cups->Density[frac_1]; + else +- out[1] = (frac)cupsDensity[c]; ++ out[1] = (frac)cups->Density[c]; + + if (m < 0) + out[2] = 0; + else if (m > frac_1) +- out[2] = (frac)cupsDensity[frac_1]; ++ out[2] = (frac)cups->Density[frac_1]; + else +- out[2] = (frac)cupsDensity[m]; ++ out[2] = (frac)cups->Density[m]; + + if (y < 0) + out[3] = 0; + else if (y > frac_1) +- out[3] = (frac)cupsDensity[frac_1]; ++ out[3] = (frac)cups->Density[frac_1]; + else +- out[3] = (frac)cupsDensity[y]; ++ out[3] = (frac)cups->Density[y]; + break; + + # ifdef CUPS_RASTER_HAVE_COLORIMETRIC +@@ -1397,9 +1521,9 @@ + } + } + +- out[0] = cupsDecodeLUT[c0]; +- out[1] = cupsDecodeLUT[c1]; +- out[2] = cupsDecodeLUT[c2]; ++ out[0] = cups->DecodeLUT[c0]; ++ out[1] = cups->DecodeLUT[c1]; ++ out[2] = cups->DecodeLUT[c2]; + break; + # endif /* CUPS_RASTER_HAVE_COLORIMETRIC */ + } +@@ -1491,21 +1615,21 @@ + * Do color correction as needed... + */ + +- if (cupsHaveProfile) ++ if (cups->HaveProfile) + { + /* + * Color correct CMY... + */ + +- tc = cupsMatrix[0][0][c] + +- cupsMatrix[0][1][m] + +- cupsMatrix[0][2][y]; +- tm = cupsMatrix[1][0][c] + +- cupsMatrix[1][1][m] + +- cupsMatrix[1][2][y]; +- ty = cupsMatrix[2][0][c] + +- cupsMatrix[2][1][m] + +- cupsMatrix[2][2][y]; ++ tc = cups->Matrix[0][0][c] + ++ cups->Matrix[0][1][m] + ++ cups->Matrix[0][2][y]; ++ tm = cups->Matrix[1][0][c] + ++ cups->Matrix[1][1][m] + ++ cups->Matrix[1][2][y]; ++ ty = cups->Matrix[2][0][c] + ++ cups->Matrix[2][1][m] + ++ cups->Matrix[2][2][y]; + + if (tc < 0) + c = 0; +@@ -1574,18 +1698,18 @@ + * Density correct... + */ + +- if (cupsHaveProfile) ++ if (cups->HaveProfile) + { +- c = cupsDensity[c]; +- m = cupsDensity[m]; +- y = cupsDensity[y]; +- k = cupsDensity[k]; ++ c = cups->Density[c]; ++ m = cups->Density[m]; ++ y = cups->Density[y]; ++ k = cups->Density[k]; + } + +- ic = cupsEncodeLUT[c]; +- im = cupsEncodeLUT[m]; +- iy = cupsEncodeLUT[y]; +- ik = cupsEncodeLUT[k]; ++ ic = cups->EncodeLUT[c]; ++ im = cups->EncodeLUT[m]; ++ iy = cups->EncodeLUT[y]; ++ ik = cups->EncodeLUT[k]; + + /* + * Convert the CMYK color to a color index... +@@ -1801,42 +1925,42 @@ + case CUPS_CSPACE_SILVER : + prgb[0] = + prgb[1] = +- prgb[2] = cupsDecodeLUT[c3]; ++ prgb[2] = cups->DecodeLUT[c3]; + break; + + case CUPS_CSPACE_W : + prgb[0] = + prgb[1] = +- prgb[2] = cupsDecodeLUT[c3]; ++ prgb[2] = cups->DecodeLUT[c3]; + break; + + case CUPS_CSPACE_RGB : +- prgb[0] = cupsDecodeLUT[c1]; +- prgb[1] = cupsDecodeLUT[c2]; +- prgb[2] = cupsDecodeLUT[c3]; ++ prgb[0] = cups->DecodeLUT[c1]; ++ prgb[1] = cups->DecodeLUT[c2]; ++ prgb[2] = cups->DecodeLUT[c3]; + break; + + case CUPS_CSPACE_RGBA : +- prgb[0] = cupsDecodeLUT[c0]; +- prgb[1] = cupsDecodeLUT[c1]; +- prgb[2] = cupsDecodeLUT[c2]; ++ prgb[0] = cups->DecodeLUT[c0]; ++ prgb[1] = cups->DecodeLUT[c1]; ++ prgb[2] = cups->DecodeLUT[c2]; + break; + + case CUPS_CSPACE_CMY : +- prgb[0] = cupsDecodeLUT[c1]; +- prgb[1] = cupsDecodeLUT[c2]; +- prgb[2] = cupsDecodeLUT[c3]; ++ prgb[0] = cups->DecodeLUT[c1]; ++ prgb[1] = cups->DecodeLUT[c2]; ++ prgb[2] = cups->DecodeLUT[c3]; + break; + + case CUPS_CSPACE_YMC : +- prgb[0] = cupsDecodeLUT[c3]; +- prgb[1] = cupsDecodeLUT[c2]; +- prgb[2] = cupsDecodeLUT[c1]; ++ prgb[0] = cups->DecodeLUT[c3]; ++ prgb[1] = cups->DecodeLUT[c2]; ++ prgb[2] = cups->DecodeLUT[c1]; + break; + + case CUPS_CSPACE_KCMY : + case CUPS_CSPACE_KCMYcm : +- k = cupsDecodeLUT[c0]; ++ k = cups->DecodeLUT[c0]; + divk = gx_max_color_value - k; + if (divk == 0) + { +@@ -1857,13 +1981,13 @@ + + case CUPS_CSPACE_RGBW : + /* +- * cupsDecodeLUT actually maps to RGBW, not CMYK... ++ * cups->DecodeLUT actually maps to RGBW, not CMYK... + */ + +- k = cupsDecodeLUT[c3]; +- c = cupsDecodeLUT[c0] + k; +- m = cupsDecodeLUT[c1] + k; +- y = cupsDecodeLUT[c2] + k; ++ k = cups->DecodeLUT[c3]; ++ c = cups->DecodeLUT[c0] + k; ++ m = cups->DecodeLUT[c1] + k; ++ y = cups->DecodeLUT[c2] + k; + + if (c > gx_max_color_value) + prgb[0] = gx_max_color_value; +@@ -1882,7 +2006,7 @@ + break; + + case CUPS_CSPACE_CMYK : +- k = cupsDecodeLUT[c3]; ++ k = cups->DecodeLUT[c3]; + divk = gx_max_color_value - k; + if (divk == 0) + { +@@ -1904,7 +2028,7 @@ + case CUPS_CSPACE_YMCK : + case CUPS_CSPACE_GMCK : + case CUPS_CSPACE_GMCS : +- k = cupsDecodeLUT[c3]; ++ k = cups->DecodeLUT[c3]; + divk = gx_max_color_value - k; + if (divk == 0) + { +@@ -1992,7 +2116,7 @@ + * Do color correction as needed... + */ + +- if (cupsHaveProfile) ++ if (cups->HaveProfile) + { + /* + * Compute CMYK values... +@@ -2014,17 +2138,17 @@ + * Color correct CMY... + */ + +- tc = cupsMatrix[0][0][ic] + +- cupsMatrix[0][1][im] + +- cupsMatrix[0][2][iy] + ++ tc = cups->Matrix[0][0][ic] + ++ cups->Matrix[0][1][im] + ++ cups->Matrix[0][2][iy] + + ik; +- tm = cupsMatrix[1][0][ic] + +- cupsMatrix[1][1][im] + +- cupsMatrix[1][2][iy] + ++ tm = cups->Matrix[1][0][ic] + ++ cups->Matrix[1][1][im] + ++ cups->Matrix[1][2][iy] + + ik; +- ty = cupsMatrix[2][0][ic] + +- cupsMatrix[2][1][im] + +- cupsMatrix[2][2][iy] + ++ ty = cups->Matrix[2][0][ic] + ++ cups->Matrix[2][1][im] + ++ cups->Matrix[2][2][iy] + + ik; + + /* +@@ -2034,23 +2158,23 @@ + if (tc < 0) + r = gx_max_color_value; + else if (tc > gx_max_color_value) +- r = gx_max_color_value - cupsDensity[gx_max_color_value]; ++ r = gx_max_color_value - cups->Density[gx_max_color_value]; + else +- r = gx_max_color_value - cupsDensity[tc]; ++ r = gx_max_color_value - cups->Density[tc]; + + if (tm < 0) + g = gx_max_color_value; + else if (tm > gx_max_color_value) +- g = gx_max_color_value - cupsDensity[gx_max_color_value]; ++ g = gx_max_color_value - cups->Density[gx_max_color_value]; + else +- g = gx_max_color_value - cupsDensity[tm]; ++ g = gx_max_color_value - cups->Density[tm]; + + if (ty < 0) + b = gx_max_color_value; + else if (ty > gx_max_color_value) +- b = gx_max_color_value - cupsDensity[gx_max_color_value]; ++ b = gx_max_color_value - cups->Density[gx_max_color_value]; + else +- b = gx_max_color_value - cupsDensity[ty]; ++ b = gx_max_color_value - cups->Density[ty]; + } + + /* +@@ -2060,13 +2184,13 @@ + switch (cups->header.cupsColorSpace) + { + case CUPS_CSPACE_W : +- i = cupsEncodeLUT[(r * 31 + g * 61 + b * 8) / 100]; ++ i = cups->EncodeLUT[(r * 31 + g * 61 + b * 8) / 100]; + break; + + case CUPS_CSPACE_RGB : +- ic = cupsEncodeLUT[r]; +- im = cupsEncodeLUT[g]; +- iy = cupsEncodeLUT[b]; ++ ic = cups->EncodeLUT[r]; ++ im = cups->EncodeLUT[g]; ++ iy = cups->EncodeLUT[b]; + + switch (cups->header.cupsBitsPerColor) + { +@@ -2121,9 +2245,9 @@ + } + + case CUPS_CSPACE_RGBA : +- ic = cupsEncodeLUT[r]; +- im = cupsEncodeLUT[g]; +- iy = cupsEncodeLUT[b]; ++ ic = cups->EncodeLUT[r]; ++ im = cups->EncodeLUT[g]; ++ iy = cups->EncodeLUT[b]; + + switch (cups->header.cupsBitsPerColor) + { +@@ -2148,13 +2272,13 @@ + break; + + default : +- i = cupsEncodeLUT[gx_max_color_value - (r * 31 + g * 61 + b * 8) / 100]; ++ i = cups->EncodeLUT[gx_max_color_value - (r * 31 + g * 61 + b * 8) / 100]; + break; + + case CUPS_CSPACE_CMY : +- ic = cupsEncodeLUT[gx_max_color_value - r]; +- im = cupsEncodeLUT[gx_max_color_value - g]; +- iy = cupsEncodeLUT[gx_max_color_value - b]; ++ ic = cups->EncodeLUT[gx_max_color_value - r]; ++ im = cups->EncodeLUT[gx_max_color_value - g]; ++ iy = cups->EncodeLUT[gx_max_color_value - b]; + + switch (cups->header.cupsBitsPerColor) + { +@@ -2179,9 +2303,9 @@ + break; + + case CUPS_CSPACE_YMC : +- ic = cupsEncodeLUT[gx_max_color_value - r]; +- im = cupsEncodeLUT[gx_max_color_value - g]; +- iy = cupsEncodeLUT[gx_max_color_value - b]; ++ ic = cups->EncodeLUT[gx_max_color_value - r]; ++ im = cups->EncodeLUT[gx_max_color_value - g]; ++ iy = cups->EncodeLUT[gx_max_color_value - b]; + + switch (cups->header.cupsBitsPerColor) + { +@@ -2210,10 +2334,10 @@ + ik = (int)((float)ik * (float)ik * (float)ik / + ((float)mk * (float)mk)); + +- ic = cupsEncodeLUT[ic - ik]; +- im = cupsEncodeLUT[im - ik]; +- iy = cupsEncodeLUT[iy - ik]; +- ik = cupsEncodeLUT[ik]; ++ ic = cups->EncodeLUT[ic - ik]; ++ im = cups->EncodeLUT[im - ik]; ++ iy = cups->EncodeLUT[iy - ik]; ++ ik = cups->EncodeLUT[ik]; + + switch (cups->header.cupsBitsPerColor) + { +@@ -2254,10 +2378,10 @@ + ik = (int)((float)ik * (float)ik * (float)ik / + ((float)mk * (float)mk)); + +- ic = cupsEncodeLUT[ic - ik]; +- im = cupsEncodeLUT[im - ik]; +- iy = cupsEncodeLUT[iy - ik]; +- ik = cupsEncodeLUT[ik]; ++ ic = cups->EncodeLUT[ic - ik]; ++ im = cups->EncodeLUT[im - ik]; ++ iy = cups->EncodeLUT[iy - ik]; ++ ik = cups->EncodeLUT[ik]; + + switch (cups->header.cupsBitsPerColor) + { +@@ -2293,10 +2417,10 @@ + ik = (int)((float)ik * (float)ik * (float)ik / + ((float)mk * (float)mk)); + +- ic = cupsEncodeLUT[ic - ik]; +- im = cupsEncodeLUT[im - ik]; +- iy = cupsEncodeLUT[iy - ik]; +- ik = cupsEncodeLUT[ik]; ++ ic = cups->EncodeLUT[ic - ik]; ++ im = cups->EncodeLUT[im - ik]; ++ iy = cups->EncodeLUT[iy - ik]; ++ ik = cups->EncodeLUT[ik]; + if (ik) + i = 32; + else if (ic && im) +@@ -2326,10 +2450,10 @@ + ik = (int)((float)ik * (float)ik * (float)ik / + ((float)mk * (float)mk)); + +- ic = cupsEncodeLUT[ic - ik]; +- im = cupsEncodeLUT[im - ik]; +- iy = cupsEncodeLUT[iy - ik]; +- ik = cupsEncodeLUT[ik]; ++ ic = cups->EncodeLUT[ic - ik]; ++ im = cups->EncodeLUT[im - ik]; ++ iy = cups->EncodeLUT[iy - ik]; ++ ik = cups->EncodeLUT[ik]; + + switch (cups->header.cupsBitsPerColor) + { +@@ -2529,8 +2653,8 @@ + if ((code = gdev_prn_open(pdev)) != 0) + return (code); + +- if (cupsPPD == NULL) +- cupsPPD = ppdOpenFile(getenv("PPD")); ++ if (cups->PPD == NULL) ++ cups->PPD = ppdOpenFile(getenv("PPD")); + + return (0); + } +@@ -2547,6 +2671,7 @@ + int num_copies) + /* I - Number of copies */ + { ++ int code = 0; /* Error code */ + int copy; /* Copy number */ + int srcbytes; /* Byte width of scanline */ + unsigned char *src, /* Scanline data */ +@@ -2601,6 +2726,8 @@ + if (src == NULL) /* can't allocate input buffer */ + return_error(gs_error_VMerror); + ++ memset(src, 0, srcbytes); ++ + /* + * Need an output buffer, too... + */ +@@ -2611,6 +2738,8 @@ + if (dst == NULL) /* can't allocate working area */ + return_error(gs_error_VMerror); + ++ memset(dst, 0, 2 * cups->header.cupsBytesPerLine); ++ + /* + * See if the stream has been initialized yet... + */ +@@ -2621,7 +2750,7 @@ + CUPS_RASTER_WRITE)) == NULL) + { + perror("ERROR: Unable to open raster stream - "); +- gs_exit(gs_lib_ctx_get_non_gc_memory_t(), 0); ++ return_error(gs_error_ioerror); + } + } + +@@ -2632,7 +2761,7 @@ + if (num_copies < 1) + num_copies = 1; + +- if (cupsPPD != NULL && !cupsPPD->manual_copies) ++ if (cups->PPD != NULL && !cups->PPD->manual_copies) + { + cups->header.NumCopies = num_copies; + num_copies = 1; +@@ -2647,20 +2776,22 @@ + cupsRasterWriteHeader(cups->stream, &(cups->header)); + + if (pdev->color_info.num_components == 1) +- cups_print_chunked(pdev, src, dst, srcbytes); ++ code = cups_print_chunked(pdev, src, dst, srcbytes); + else + switch (cups->header.cupsColorOrder) + { + case CUPS_ORDER_CHUNKED : +- cups_print_chunked(pdev, src, dst, srcbytes); ++ code = cups_print_chunked(pdev, src, dst, srcbytes); + break; + case CUPS_ORDER_BANDED : +- cups_print_banded(pdev, src, dst, srcbytes); ++ code = cups_print_banded(pdev, src, dst, srcbytes); + break; + case CUPS_ORDER_PLANAR : +- cups_print_planar(pdev, src, dst, srcbytes); ++ code = cups_print_planar(pdev, src, dst, srcbytes); + break; + } ++ if (code < 0) ++ break; + } + + /* +@@ -2670,6 +2801,9 @@ + gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)src, srcbytes, 1, "cups_print_pages"); + gs_free(gs_lib_ctx_get_non_gc_memory_t(), (char *)dst, cups->header.cupsBytesPerLine, 1, "cups_print_pages"); + ++ if (code < 0) ++ return (code); ++ + cups->page ++; + dprintf1("INFO: Processing page %d...\n", cups->page); + +@@ -2703,16 +2837,15 @@ + 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 */ +- static int width_old = 0, /* Previous width */ +- height_old = 0; /* Previous height */ ++ height, /* New height of page */ ++ width_old = 0, /* Previous width of page */ ++ height_old = 0; /* Previous height of page */ + ppd_attr_t *backside = NULL, + *backsiderequiresflippedmargins = NULL; + float swap; + int xflip = 0, + yflip = 0; + int found = 0; +- static int lastpage = 0; + + dprintf2("DEBUG2: cups_put_params(%p, %p)\n", pdev, plist); + +@@ -2724,15 +2857,15 @@ + if ((code = param_read_string(plist, sname, &stringval)) < 0) \ + { \ + dprintf2("ERROR: Error setting %s to \"%s\"...\n", sname, \ +- (char *)stringval.data); \ ++ (char *)(stringval.data)); \ + param_signal_error(plist, sname, code); \ + return (code); \ + } \ + else if (code == 0) \ + { \ + dprintf2("DEBUG: Setting %s to \"%s\"...\n", sname, \ +- (char *)stringval.data); \ +- strncpy(cups->header.name, (const char *)stringval.data, \ ++ (char *)(stringval.data)); \ ++ strncpy(cups->header.name, (const char *)(stringval.data), \ + stringval.size); \ + cups->header.name[stringval.size] = '\0'; \ + } +@@ -2800,9 +2933,10 @@ + 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"); \ + } + +@@ -2813,11 +2947,11 @@ + param_read_int(plist, "cupsBitsPerColor", &intval) == 0; + /* We also recompute page size and margins if we simply get onto a new + page without necessarily having a page size change in the PostScript +- code, as for some printers margins have to flipped on the back sides of ++ code, as for some printers margins have to be flipped on the back sides of + the sheets (even pages) when printing duplex */ +- if (cups->page != lastpage) { ++ if (cups->page != cups->lastpage) { + size_set = 1; +- lastpage = cups->page; ++ cups->lastpage = cups->page; + } + + stringoption(MediaClass, "MediaClass") +@@ -2891,17 +3025,17 @@ + stringoption(cupsPageSizeName, "cupsPageSizeName"); + #endif /* CUPS_RASTER_SYNCv1 */ + +- if ((code = param_read_string(plist, "cupsProfile", &stringval)) < 0) ++ if ((code = param_read_string(plist, "cups->Profile", &stringval)) < 0) + { +- param_signal_error(plist, "cupsProfile", code); ++ param_signal_error(plist, "cups->Profile", code); + return (code); + } + else if (code == 0) + { +- if (cupsProfile != NULL) +- free(cupsProfile); ++ if (cups->Profile != NULL) ++ free(cups->Profile); + +- cupsProfile = strdup((char *)stringval.data); ++ cups->Profile = strdup((char *)stringval.data); + } + + cups_set_color_info(pdev); +@@ -2930,22 +3064,22 @@ + + cups->landscape = 0; + +- if (cupsPPD != NULL) ++ if (cups->PPD != NULL) + { + dprintf1("DEBUG2: cups->header.Duplex = %d\n", cups->header.Duplex); + dprintf1("DEBUG2: cups->header.Tumble = %d\n", cups->header.Tumble); + dprintf1("DEBUG2: cups->page = %d\n", cups->page); +- dprintf1("DEBUG2: cupsPPD = %p\n", cupsPPD); ++ dprintf1("DEBUG2: cups->PPD = %p\n", cups->PPD); + +- backside = ppdFindAttr(cupsPPD, "cupsBackSide", NULL); ++ backside = ppdFindAttr(cups->PPD, "cupsBackSide", NULL); + if (backside) { + dprintf1("DEBUG2: cupsBackSide = %s\n", backside->value); +- cupsPPD->flip_duplex = 0; ++ cups->PPD->flip_duplex = 0; + } +- dprintf1("DEBUG2: cupsPPD->flip_duplex = %d\n", cupsPPD->flip_duplex); ++ dprintf1("DEBUG2: cups->PPD->flip_duplex = %d\n", cups->PPD->flip_duplex); + + backsiderequiresflippedmargins = +- ppdFindAttr(cupsPPD, "APDuplexRequiresFlippedMargin", NULL); ++ ppdFindAttr(cups->PPD, "APDuplexRequiresFlippedMargin", NULL); + if (backsiderequiresflippedmargins) + dprintf1("DEBUG2: APDuplexRequiresFlippedMargin = %s\n", + backsiderequiresflippedmargins->value); +@@ -2982,7 +3116,7 @@ + } + else if (cups->header.Duplex && + ((!cups->header.Tumble && +- (cupsPPD->flip_duplex || ++ (cups->PPD->flip_duplex || + (backside && !strcasecmp(backside->value, "Rotated")))) || + (cups->header.Tumble && + (backside && !strcasecmp(backside->value, "ManualTumble")))) && +@@ -3012,7 +3146,7 @@ + + if (strlen(cups->header.cupsPageSizeName) != 0) { + found = 0; +- for (i = cupsPPD->num_sizes, size = cupsPPD->sizes; ++ for (i = cups->PPD->num_sizes, size = cups->PPD->sizes; + i > 0; + i --, size ++) + if (strcasecmp(cups->header.cupsPageSizeName, size->name) == 0) { +@@ -3028,7 +3162,7 @@ + * Find the matching page size... + */ + +- for (i = cupsPPD->num_sizes, size = cupsPPD->sizes; ++ for (i = cups->PPD->num_sizes, size = cups->PPD->sizes; + i > 0; + i --, size ++) + if (fabs(cups->MediaSize[1] - size->length) < 5.0 && +@@ -3063,6 +3197,8 @@ + + gx_device_set_media_size(pdev, size->width, size->length); + ++ cups->landscape = 0; ++ + margins[0] = size->left / 72.0; + margins[1] = size->bottom / 72.0; + margins[2] = (size->width - size->right) / 72.0; +@@ -3083,7 +3219,7 @@ + * landscape orientation... + */ + +- for (i = cupsPPD->num_sizes, size = cupsPPD->sizes; ++ for (i = cups->PPD->num_sizes, size = cups->PPD->sizes; + i > 0; + i --, size ++) + if (fabs(cups->MediaSize[0] - size->length) < 5.0 && +@@ -3141,8 +3277,10 @@ + + dprintf("DEBUG: size = Custom\n"); + ++ cups->landscape = 0; ++ + for (i = 0; i < 4; i ++) +- margins[i] = cupsPPD->custom_margins[i] / 72.0; ++ margins[i] = cups->PPD->custom_margins[i] / 72.0; + if (xflip == 1) + { + swap = margins[0]; margins[0] = margins[2]; margins[2] = swap; +@@ -3166,50 +3304,6 @@ + } + + /* +- * Set CUPS raster header values... +- */ +- +- cups->header.HWResolution[0] = pdev->HWResolution[0]; +- cups->header.HWResolution[1] = pdev->HWResolution[1]; +- +-#ifdef CUPS_RASTER_SYNCv1 +- cups->header.cupsPageSize[0] = pdev->MediaSize[0]; +- cups->header.cupsPageSize[1] = pdev->MediaSize[1]; +- +- cups->header.cupsImagingBBox[0] = pdev->HWMargins[0]; +- cups->header.cupsImagingBBox[1] = pdev->HWMargins[1]; +- cups->header.cupsImagingBBox[2] = pdev->MediaSize[0] - pdev->HWMargins[2]; +- cups->header.cupsImagingBBox[3] = pdev->MediaSize[1] - pdev->HWMargins[3]; +- +- if ((sf = cups->header.cupsBorderlessScalingFactor) < 1.0) +- sf = 1.0; +- +- cups->header.Margins[0] = pdev->HWMargins[0] * sf; +- cups->header.Margins[1] = pdev->HWMargins[1] * sf; +- +- cups->header.PageSize[0] = pdev->MediaSize[0] * sf; +- cups->header.PageSize[1] = pdev->MediaSize[1] * sf; +- +- cups->header.ImagingBoundingBox[0] = pdev->HWMargins[0] * sf; +- cups->header.ImagingBoundingBox[1] = pdev->HWMargins[1] * sf; +- cups->header.ImagingBoundingBox[2] = (pdev->MediaSize[0] - +- pdev->HWMargins[2]) * sf; +- cups->header.ImagingBoundingBox[3] = (pdev->MediaSize[1] - +- pdev->HWMargins[3]) * sf; +-#else +- cups->header.Margins[0] = pdev->HWMargins[0]; +- cups->header.Margins[1] = pdev->HWMargins[1]; +- +- cups->header.PageSize[0] = pdev->MediaSize[0]; +- cups->header.PageSize[1] = pdev->MediaSize[1]; +- +- cups->header.ImagingBoundingBox[0] = pdev->HWMargins[0]; +- cups->header.ImagingBoundingBox[1] = pdev->HWMargins[3]; +- cups->header.ImagingBoundingBox[2] = pdev->MediaSize[0] - pdev->HWMargins[2]; +- cups->header.ImagingBoundingBox[3] = pdev->MediaSize[1] - pdev->HWMargins[1]; +-#endif /* CUPS_RASTER_SYNCv1 */ +- +- /* + * Reallocate memory if the size or color depth was changed... + */ + +@@ -3220,6 +3314,8 @@ + * does not keep track of the margins in the bitmap size... + */ + ++ width_old = pdev->width; ++ height_old = pdev->height; + if (cups->landscape) + { + width = (pdev->MediaSize[1] - pdev->HWMargins[1] - pdev->HWMargins[3]) * +@@ -3242,18 +3338,17 @@ + height *= cups->header.cupsBorderlessScalingFactor; + } + #endif /* CUPS_RASTER_SYNCv1 */ ++ pdev->width = width; ++ pdev->height = height; + + /* + * 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_old = width; +- height_old = height; +- + /* + * Device is open and size has changed, so reallocate... + */ +@@ -3263,8 +3358,11 @@ + + sp = ((gx_device_printer *)pdev)->space_params; + +- if ((code = gdev_prn_reallocate_memory(pdev, &sp, width, height)) < 0) ++ if ((code = gdev_prn_maybe_realloc_memory(pdev, &sp, ++ width_old, height_old)) < 0) + return (code); ++ dprintf4("DEBUG2: Reallocated memory, [%.0f %.0f] = %dx%d pixels...\n", ++ pdev->MediaSize[0], pdev->MediaSize[1], width, height); + } + else + { +@@ -3280,7 +3378,106 @@ + } + } + +- dprintf1("DEBUG2: ppd = %p\n", cupsPPD); ++ /* ++ * Set CUPS raster header values... ++ */ ++ ++ cups->header.HWResolution[0] = pdev->HWResolution[0]; ++ cups->header.HWResolution[1] = pdev->HWResolution[1]; ++ ++#ifdef CUPS_RASTER_SYNCv1 ++ ++ if (cups->landscape) ++ { ++ cups->header.cupsPageSize[0] = pdev->MediaSize[1]; ++ cups->header.cupsPageSize[1] = pdev->MediaSize[0]; ++ ++ cups->header.cupsImagingBBox[0] = pdev->HWMargins[1]; ++ cups->header.cupsImagingBBox[1] = pdev->HWMargins[2]; ++ cups->header.cupsImagingBBox[2] = pdev->MediaSize[1] - pdev->HWMargins[3]; ++ cups->header.cupsImagingBBox[3] = pdev->MediaSize[0] - pdev->HWMargins[0]; ++ ++ if ((sf = cups->header.cupsBorderlessScalingFactor) < 1.0) ++ sf = 1.0; ++ ++ cups->header.Margins[0] = pdev->HWMargins[1] * sf; ++ cups->header.Margins[1] = pdev->HWMargins[2] * sf; ++ ++ cups->header.PageSize[0] = pdev->MediaSize[1] * sf; ++ cups->header.PageSize[1] = pdev->MediaSize[0] * sf; ++ ++ cups->header.ImagingBoundingBox[0] = pdev->HWMargins[1] * sf; ++ cups->header.ImagingBoundingBox[1] = pdev->HWMargins[2] * sf; ++ cups->header.ImagingBoundingBox[2] = (pdev->MediaSize[1] - ++ pdev->HWMargins[3]) * sf; ++ cups->header.ImagingBoundingBox[3] = (pdev->MediaSize[0] - ++ pdev->HWMargins[0]) * sf; ++ } ++ else ++ { ++ cups->header.cupsPageSize[0] = pdev->MediaSize[0]; ++ cups->header.cupsPageSize[1] = pdev->MediaSize[1]; ++ ++ cups->header.cupsImagingBBox[0] = pdev->HWMargins[0]; ++ cups->header.cupsImagingBBox[1] = pdev->HWMargins[1]; ++ cups->header.cupsImagingBBox[2] = pdev->MediaSize[0] - pdev->HWMargins[2]; ++ cups->header.cupsImagingBBox[3] = pdev->MediaSize[1] - pdev->HWMargins[3]; ++ ++ if ((sf = cups->header.cupsBorderlessScalingFactor) < 1.0) ++ sf = 1.0; ++ ++ cups->header.Margins[0] = pdev->HWMargins[0] * sf; ++ cups->header.Margins[1] = pdev->HWMargins[1] * sf; ++ ++ cups->header.PageSize[0] = pdev->MediaSize[0] * sf; ++ cups->header.PageSize[1] = pdev->MediaSize[1] * sf; ++ ++ cups->header.ImagingBoundingBox[0] = pdev->HWMargins[0] * sf; ++ cups->header.ImagingBoundingBox[1] = pdev->HWMargins[1] * sf; ++ cups->header.ImagingBoundingBox[2] = (pdev->MediaSize[0] - ++ pdev->HWMargins[2]) * sf; ++ cups->header.ImagingBoundingBox[3] = (pdev->MediaSize[1] - ++ pdev->HWMargins[3]) * sf; ++ } ++ ++#else ++ ++ if (cups->landscape) ++ { ++ cups->header.Margins[0] = pdev->HWMargins[1]; ++ cups->header.Margins[1] = pdev->HWMargins[2]; ++ ++ cups->header.PageSize[0] = pdev->MediaSize[1]; ++ cups->header.PageSize[1] = pdev->MediaSize[0]; ++ ++ cups->header.ImagingBoundingBox[0] = pdev->HWMargins[1]; ++ cups->header.ImagingBoundingBox[1] = pdev->HWMargins[0]; ++ cups->header.ImagingBoundingBox[2] = pdev->MediaSize[1] - ++ pdev->HWMargins[3]; ++ cups->header.ImagingBoundingBox[3] = pdev->MediaSize[0] - ++ pdev->HWMargins[2]; ++ } ++ else ++ { ++ cups->header.Margins[0] = pdev->HWMargins[0]; ++ cups->header.Margins[1] = pdev->HWMargins[1]; ++ ++ cups->header.PageSize[0] = pdev->MediaSize[0]; ++ cups->header.PageSize[1] = pdev->MediaSize[1]; ++ ++ cups->header.ImagingBoundingBox[0] = pdev->HWMargins[0]; ++ cups->header.ImagingBoundingBox[1] = pdev->HWMargins[3]; ++ cups->header.ImagingBoundingBox[2] = pdev->MediaSize[0] - ++ pdev->HWMargins[2]; ++ cups->header.ImagingBoundingBox[3] = pdev->MediaSize[1] - ++ pdev->HWMargins[1]; ++ } ++ ++#endif /* CUPS_RASTER_SYNCv1 */ ++ cups->header.cupsWidth = cups->width; ++ cups->header.cupsHeight = cups->height; ++ ++ dprintf1("DEBUG2: ppd = %p\n", cups->PPD); + dprintf2("DEBUG2: PageSize = [ %.3f %.3f ]\n", + pdev->MediaSize[0], pdev->MediaSize[1]); + dprintf4("DEBUG2: margins = [ %.3f %.3f %.3f %.3f ]\n", +@@ -3562,20 +3759,20 @@ + j = ((j & 255) << 8) | ((j >> 8) & 255); + #endif /* !ARCH_IS_BIG_ENDIAN */ + +- cupsEncodeLUT[i] = j; ++ cups->EncodeLUT[i] = j; + + #ifdef DEBUG +- if (i == 0 || cupsEncodeLUT[i] != cupsEncodeLUT[i - 1]) +- dprintf2("DEBUG2: cupsEncodeLUT[%d] = %d\n", i, (int)cupsEncodeLUT[i]); ++ if (i == 0 || cups->EncodeLUT[i] != cups->EncodeLUT[i - 1]) ++ dprintf2("DEBUG2: cups->EncodeLUT[%d] = %d\n", i, (int)cups->EncodeLUT[i]); + #endif /* DEBUG */ + } + +- dprintf1("DEBUG2: cupsEncodeLUT[0] = %d\n", (int)cupsEncodeLUT[0]); +- dprintf2("DEBUG2: cupsEncodeLUT[%d] = %d\n", gx_max_color_value, +- (int)cupsEncodeLUT[gx_max_color_value]); ++ dprintf1("DEBUG2: cups->EncodeLUT[0] = %d\n", (int)cups->EncodeLUT[0]); ++ dprintf2("DEBUG2: cups->EncodeLUT[%d] = %d\n", gx_max_color_value, ++ (int)cups->EncodeLUT[gx_max_color_value]); + + for (i = 0; i < cups->color_info.dither_grays; i ++) +- cupsDecodeLUT[i] = gx_max_color_value * i / max_lut; ++ cups->DecodeLUT[i] = gx_max_color_value * i / max_lut; + + dprintf2("DEBUG: num_components = %d, depth = %d\n", + cups->color_info.num_components, cups->color_info.depth); +@@ -3592,24 +3789,24 @@ + * Set the color profile as needed... + */ + +- cupsHaveProfile = 0; ++ cups->HaveProfile = 0; + + #ifdef dev_t_proc_encode_color +- if (cupsProfile) ++ if (cups->Profile) + #else +- if (cupsProfile && cups->header.cupsBitsPerColor == 8) ++ if (cups->Profile && cups->header.cupsBitsPerColor == 8) + #endif /* dev_t_proc_encode_color */ + { +- dprintf1("DEBUG: Using user-defined profile \"%s\"...\n", cupsProfile); ++ dprintf1("DEBUG: Using user-defined profile \"%s\"...\n", cups->Profile); + +- if (sscanf(cupsProfile, "%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f", &d, &g, ++ if (sscanf(cups->Profile, "%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f", &d, &g, + m[0] + 0, m[0] + 1, m[0] + 2, + m[1] + 0, m[1] + 1, m[1] + 2, + m[2] + 0, m[2] + 1, m[2] + 2) != 11) + dprintf("ERROR: User-defined profile does not contain 11 integers!\n"); + else + { +- cupsHaveProfile = 1; ++ cups->HaveProfile = 1; + + d *= 0.001f; + g *= 0.001f; +@@ -3625,9 +3822,9 @@ + } + } + #ifdef dev_t_proc_encode_color +- else if (cupsPPD) ++ else if (cups->PPD) + #else +- else if (cupsPPD && cups->header.cupsBitsPerColor == 8) ++ else if (cups->PPD && cups->header.cupsBitsPerColor == 8) + #endif /* dev_t_proc_encode_color */ + { + /* +@@ -3640,8 +3837,8 @@ + else + sprintf(resolution, "%.0fdpi", pdev->HWResolution[0]); + +- for (i = 0, profile = cupsPPD->profiles; +- i < cupsPPD->num_profiles; ++ for (i = 0, profile = cups->PPD->profiles; ++ i < cups->PPD->num_profiles; + i ++, profile ++) + if ((strcmp(profile->resolution, resolution) == 0 || + profile->resolution[0] == '-') && +@@ -3653,11 +3850,11 @@ + * If we found a color profile, use it! + */ + +- if (i < cupsPPD->num_profiles) ++ if (i < cups->PPD->num_profiles) + { + dprintf("DEBUG: Using color profile in PPD file!\n"); + +- cupsHaveProfile = 1; ++ cups->HaveProfile = 1; + + d = profile->density; + g = profile->gamma; +@@ -3666,34 +3863,34 @@ + } + } + +- if (cupsHaveProfile) ++ if (cups->HaveProfile) + { + for (i = 0; i < 3; i ++) + for (j = 0; j < 3; j ++) + for (k = 0; k <= CUPS_MAX_VALUE; k ++) + { +- cupsMatrix[i][j][k] = (int)((float)k * m[i][j] + 0.5); ++ cups->Matrix[i][j][k] = (int)((float)k * m[i][j] + 0.5); + + if ((k & 4095) == 0) +- dprintf4("DEBUG2: cupsMatrix[%d][%d][%d] = %d\n", +- i, j, k, cupsMatrix[i][j][k]); ++ dprintf4("DEBUG2: cups->Matrix[%d][%d][%d] = %d\n", ++ i, j, k, cups->Matrix[i][j][k]); + } + + + for (k = 0; k <= CUPS_MAX_VALUE; k ++) + { +- cupsDensity[k] = (int)((float)CUPS_MAX_VALUE * d * ++ cups->Density[k] = (int)((float)CUPS_MAX_VALUE * d * + pow((float)k / (float)CUPS_MAX_VALUE, g) + + 0.5); + + if ((k & 4095) == 0) +- dprintf2("DEBUG2: cupsDensity[%d] = %d\n", k, cupsDensity[k]); ++ dprintf2("DEBUG2: cups->Density[%d] = %d\n", k, cups->Density[k]); + } + } + else + { + for (k = 0; k <= CUPS_MAX_VALUE; k ++) +- cupsDensity[k] = k; ++ cups->Density[k] = k; + } + } + +@@ -3715,7 +3912,7 @@ + * 'cups_print_chunked()' - Print a page of chunked pixels. + */ + +-static void ++static int + cups_print_chunked(gx_device_printer *pdev, + /* I - Printer device */ + unsigned char *src, +@@ -3737,18 +3934,18 @@ + dprintf1("DEBUG2: cups->header.Duplex = %d\n", cups->header.Duplex); + dprintf1("DEBUG2: cups->header.Tumble = %d\n", cups->header.Tumble); + dprintf1("DEBUG2: cups->page = %d\n", cups->page); +- dprintf1("DEBUG2: cupsPPD = %p\n", cupsPPD); ++ dprintf1("DEBUG2: cups->PPD = %p\n", cups->PPD); + +- if (cupsPPD) { +- backside = ppdFindAttr(cupsPPD, "cupsBackSide", NULL); ++ if (cups->PPD) { ++ backside = ppdFindAttr(cups->PPD, "cupsBackSide", NULL); + if (backside) { + dprintf1("DEBUG2: cupsBackSide = %s\n", backside->value); +- cupsPPD->flip_duplex = 0; ++ cups->PPD->flip_duplex = 0; + } + } +- if (cups->header.Duplex && cupsPPD && ++ if (cups->header.Duplex && cups->PPD && + ((!cups->header.Tumble && +- (cupsPPD->flip_duplex || ++ (cups->PPD->flip_duplex || + (backside && !strcasecmp(backside->value, "Rotated")))) || + (cups->header.Tumble && + (backside && (!strcasecmp(backside->value, "Flipped") || +@@ -3757,9 +3954,9 @@ + xflip = 1; + else + xflip = 0; +- if (cups->header.Duplex && cupsPPD && ++ if (cups->header.Duplex && cups->PPD && + ((!cups->header.Tumble && +- (cupsPPD->flip_duplex || ++ (cups->PPD->flip_duplex || + (backside && (!strcasecmp(backside->value, "Flipped") || + !strcasecmp(backside->value, "Rotated"))))) || + (cups->header.Tumble && +@@ -3792,7 +3989,7 @@ + if (gdev_prn_get_bits((gx_device_printer *)pdev, y, src, &srcptr) < 0) + { + dprintf1("ERROR: Unable to get scanline %d!\n", y); +- gs_exit(gs_lib_ctx_get_non_gc_memory_t(), 1); ++ return_error(gs_error_unknownerror); + } + + if (xflip) +@@ -3815,8 +4012,8 @@ + count > 0; + count --, srcptr --, dstptr ++) + { +- *dstptr = cupsRevUpper1[*srcptr & 15] | +- cupsRevLower1[*srcptr >> 4]; ++ *dstptr = cups->RevUpper1[*srcptr & 15] | ++ cups->RevLower1[*srcptr >> 4]; + } + break; + +@@ -3825,8 +4022,8 @@ + count > 0; + count --, srcptr --, dstptr ++) + { +- *dstptr = cupsRevUpper2[*srcptr & 15] | +- cupsRevLower2[*srcptr >> 4]; ++ *dstptr = cups->RevUpper2[*srcptr & 15] | ++ cups->RevLower2[*srcptr >> 4]; + } + break; + +@@ -3924,6 +4121,7 @@ + cupsRasterWritePixels(cups->stream, srcptr, cups->header.cupsBytesPerLine); + } + } ++ return (0); + } + + +@@ -3931,7 +4129,7 @@ + * 'cups_print_banded()' - Print a page of banded pixels. + */ + +-static void ++static int + cups_print_banded(gx_device_printer *pdev, + /* I - Printer device */ + unsigned char *src, +@@ -3957,18 +4155,18 @@ + dprintf1("DEBUG2: cups->header.Duplex = %d\n", cups->header.Duplex); + dprintf1("DEBUG2: cups->header.Tumble = %d\n", cups->header.Tumble); + dprintf1("DEBUG2: cups->page = %d\n", cups->page); +- dprintf1("DEBUG2: cupsPPD = %p\n", cupsPPD); ++ dprintf1("DEBUG2: cups->PPD = %p\n", cups->PPD); + +- if (cupsPPD) { +- backside = ppdFindAttr(cupsPPD, "cupsBackSide", NULL); ++ if (cups->PPD) { ++ backside = ppdFindAttr(cups->PPD, "cupsBackSide", NULL); + if (backside) { + dprintf1("DEBUG2: cupsBackSide = %s\n", backside->value); +- cupsPPD->flip_duplex = 0; ++ cups->PPD->flip_duplex = 0; + } + } +- if (cups->header.Duplex && cupsPPD && ++ if (cups->header.Duplex && cups->PPD && + ((!cups->header.Tumble && +- (cupsPPD->flip_duplex || ++ (cups->PPD->flip_duplex || + (backside && !strcasecmp(backside->value, "Rotated")))) || + (cups->header.Tumble && + (backside && (!strcasecmp(backside->value, "Flipped") || +@@ -3977,9 +4175,9 @@ + xflip = 1; + else + xflip = 0; +- if (cups->header.Duplex && cupsPPD && ++ if (cups->header.Duplex && cups->PPD && + ((!cups->header.Tumble && +- (cupsPPD->flip_duplex || ++ (cups->PPD->flip_duplex || + (backside && (!strcasecmp(backside->value, "Flipped") || + !strcasecmp(backside->value, "Rotated"))))) || + (cups->header.Tumble && +@@ -4023,7 +4221,7 @@ + if (gdev_prn_get_bits((gx_device_printer *)pdev, y, src, &srcptr) < 0) + { + dprintf1("ERROR: Unable to get scanline %d!\n", y); +- gs_exit(gs_lib_ctx_get_non_gc_memory_t(), 1); ++ return_error(gs_error_unknownerror); + } + + /* +@@ -4629,6 +4827,7 @@ + + cupsRasterWritePixels(cups->stream, dst, cups->header.cupsBytesPerLine); + } ++ return (0); + } + + +@@ -4636,7 +4835,7 @@ + * 'cups_print_planar()' - Print a page of planar pixels. + */ + +-static void ++static int + cups_print_planar(gx_device_printer *pdev, + /* I - Printer device */ + unsigned char *src, +@@ -4673,7 +4872,7 @@ + if (gdev_prn_get_bits((gx_device_printer *)pdev, y, src, &srcptr) < 0) + { + dprintf1("ERROR: Unable to get scanline %d!\n", y); +- gs_exit(gs_lib_ctx_get_non_gc_memory_t(), 1); ++ return_error(gs_error_unknownerror); + } + + /* +@@ -5000,9 +5199,10 @@ + + cupsRasterWritePixels(cups->stream, dst, cups->header.cupsBytesPerLine); + } ++ return (0); + } + + + /* +- * End of "$Id: gdevcups.c 10631 2010-01-22 17:46:02Z till $". ++ * End of "$Id: gdevcups.c 11149 2010-04-28 22:37:01Z till $". + */ --- ghostscript-8.71.dfsg.1.orig/debian/patches/pdf-interpreter-segfault-fixes.dpatch +++ ghostscript-8.71.dfsg.1/debian/patches/pdf-interpreter-segfault-fixes.dpatch @@ -0,0 +1,204 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## pdf-interpreter-segfault-fixes.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad ghostscript-8.71.dfsg.1~/base/gdevp14.c ghostscript-8.71.dfsg.1/base/gdevp14.c +--- ghostscript-8.71.dfsg.1~/base/gdevp14.c 2010-01-26 02:15:46.000000000 +0100 ++++ ghostscript-8.71.dfsg.1/base/gdevp14.c 2010-04-29 08:54:56.949835211 +0200 +@@ -2190,7 +2190,15 @@ + */ + *ptempdevproto = gs_pdf14_custom_device; + ptempdevproto->color_info = dev->color_info; +- *pdevproto = ptempdevproto; ++ /* The pdf14 device has to be 8 bit continuous tone. Force it */ ++ ptempdevproto->color_info.depth = ++ ptempdevproto->color_info.num_components * 8; ++ ptempdevproto->color_info.max_gray = 255; ++ ptempdevproto->color_info.max_color = 255; ++ ptempdevproto->color_info.dither_grays = 256; ++ ptempdevproto->color_info.dither_colors = 256; ++ ++ *pdevproto = ptempdevproto; + break; + default: /* Should not occur */ + return_error(gs_error_rangecheck); +@@ -4914,6 +4922,13 @@ + */ + *ptempdevproto = pdf14_clist_custom_device; + ptempdevproto->color_info = dev->color_info; ++ /* The pdf14 device has to be 8 bit continuous tone. Force it */ ++ ptempdevproto->color_info.depth = ++ ptempdevproto->color_info.num_components * 8; ++ ptempdevproto->color_info.max_gray = 255; ++ ptempdevproto->color_info.max_color = 255; ++ ptempdevproto->color_info.dither_grays = 256; ++ ptempdevproto->color_info.dither_colors = 256; + *pdevproto = ptempdevproto; + break; + default: /* Should not occur */ +diff -urNad ghostscript-8.71.dfsg.1~/base/gsstate.c ghostscript-8.71.dfsg.1/base/gsstate.c +--- ghostscript-8.71.dfsg.1~/base/gsstate.c 2009-12-26 19:32:35.000000000 +0100 ++++ ghostscript-8.71.dfsg.1/base/gsstate.c 2010-04-29 08:56:48.509843245 +0200 +@@ -541,6 +541,7 @@ + gx_clip_path *view_clip = pgs->view_clip; + gs_transparency_state_t *tstack = pgs->transparency_stack; + int code; ++ int prior_op = pfrom->overprint; + + pgs->view_clip = 0; /* prevent refcount decrementing */ + code = gstate_copy(pgs, pfrom, copy_for_setgstate, "gs_setgstate"); +@@ -552,8 +553,11 @@ + (pgs->show_gstate == pfrom ? pgs : saved_show); + pgs->transparency_stack = tstack; + +- /* update the overprint compositor */ +- return gs_do_set_overprint(pgs); ++ /* update the overprint compositor but only if it is different */ ++ if (pgs->overprint != prior_op ) ++ return(gs_do_set_overprint(pgs)); ++ ++ return(0); + } + + /* Get the allocator pointer of a graphics state. */ +diff -urNad ghostscript-8.71.dfsg.1~/base/gstrans.c ghostscript-8.71.dfsg.1/base/gstrans.c +--- ghostscript-8.71.dfsg.1~/base/gstrans.c 2009-12-01 00:37:23.000000000 +0100 ++++ ghostscript-8.71.dfsg.1/base/gstrans.c 2010-04-29 08:55:51.819807803 +0200 +@@ -25,6 +25,7 @@ + #include "gxblend.h" + #include "gdevp14.h" + #include "gscspace.h" ++#include "gxclist.h" + + #define PUSH_TS 0 + +@@ -140,6 +141,47 @@ + + } + ++/* This is used to keep pdf14 compositor actions from the interpreter from ++ corrupting pattern renderings. For example, if the file has a softmask, ++ the intrepter will send push and pop transparency state commands when ++ q and Q operations are encountered. If we are writing out to a pattern ++ clist that has no trasparency we do not want these state changes to ++ be entered as compositor actions in the pattern clist */ ++ ++static int ++check_for_nontrans_pattern(gs_state *pgs, unsigned char *comp_name) ++{ ++ gx_device * dev = pgs->device; ++ bool is_patt_clist = (strcmp("pattern-clist",dev->dname) == 0); ++ bool is_patt_acum = (strcmp("pattern accumulator",dev->dname) == 0); ++ ++ /* Check if we are collecting data for a pattern that has no ++ transparency. In that case, we need to ignore the state changes */ ++ if (is_patt_clist || is_patt_acum) { ++ if (is_patt_clist) { ++ gx_device_clist_writer *clwdev = (gx_device_clist_writer*) dev; ++ const gs_pattern1_instance_t *pinst = clwdev->pinst; ++ ++ if (!(pinst->template.uses_transparency)) { ++ if_debug1('v', ++ "[v]%s NOT sending in pattern\n",comp_name); ++ return(1); ++ } ++ } ++ if (is_patt_acum) { ++ gx_device_pattern_accum *padev = (gx_device_pattern_accum*) dev; ++ const gs_pattern1_instance_t *pinst = padev->instance; ++ ++ if (!(pinst->template.uses_transparency)) { ++ if_debug1('v', ++ "[v]%s NOT sending in pattern\n",comp_name); ++ return(1); ++ } ++ } ++ } ++ return(0); ++} ++ + /* + * Push a PDF 1.4 transparency compositor onto the current device. Note that + * if the current device already is a PDF 1.4 transparency compositor, the +@@ -187,7 +229,9 @@ + const gs_color_space *blend_color_space; + gs_imager_state * pis = (gs_imager_state *)pgs; + +- ++ if (check_for_nontrans_pattern(pgs, "gs_begin_transparency_group")) { ++ return(0); ++ } + /* + * Put parameters into a compositor parameter and then call the + * create_compositor. This will pass the data to the PDF 1.4 +@@ -348,6 +392,9 @@ + { + gs_pdf14trans_params_t params = { 0 }; + ++ if (check_for_nontrans_pattern(pgs, "gs_end_transparency_group")) { ++ return(0); ++ } + if_debug0('v', "[v]gs_end_transparency_group\n"); + params.pdf14_op = PDF14_END_TRANS_GROUP; /* Other parameters not used */ + return gs_state_update_pdf14trans(pgs, ¶ms); +@@ -373,6 +420,9 @@ + gs_imager_state * pis = (gs_imager_state *)pgs; + int code; + ++ if (check_for_nontrans_pattern(pgs, "gs_push_transparency_state")) { ++ return(0); ++ } + /* Set the pending flag to true, which indicates + that we need to watch for end transparency + soft masks when we are at this graphic state +@@ -418,11 +468,13 @@ + gs_imager_state * pis = (gs_imager_state *)pgs; + int code; + ++ if (check_for_nontrans_pattern(pgs, "gs_pop_transparency_state")) { ++ return(0); ++ } + /* Check if flag is set, which indicates that we have + an active softmask for the graphic state. We + need to communicate to the compositor to pop + the softmask */ +- + if ( pis->trans_flags.xstate_change ) { + + if_debug0('v', "[v]gs_pop_transparency_state sending\n"); +@@ -501,6 +553,9 @@ + gs_imager_state * pis = (gs_imager_state *)pgs; + int num_components; + ++ if (check_for_nontrans_pattern(pgs, "gs_pop_transparency_state")) { ++ return(0); ++ } + params.pdf14_op = PDF14_BEGIN_TRANS_MASK; + params.bbox = *pbbox; + params.subtype = ptmp->subtype; +@@ -671,6 +726,9 @@ + gs_pdf14trans_params_t params = { 0 }; + gs_imager_state * pis = (gs_imager_state *)pgs; + ++ if (check_for_nontrans_pattern(pgs, "gs_end_transparency_mask")) { ++ return(0); ++ } + /* If we have done a q then set a flag to watch for any Qs */ + + /* if (pis->trans_flags.xstate_pending) +diff -urNad ghostscript-8.71.dfsg.1~/base/lib.mak ghostscript-8.71.dfsg.1/base/lib.mak +--- ghostscript-8.71.dfsg.1~/base/lib.mak 2009-12-29 23:18:01.000000000 +0100 ++++ ghostscript-8.71.dfsg.1/base/lib.mak 2010-04-29 08:54:56.961058182 +0200 +@@ -2576,7 +2576,8 @@ + + $(GLOBJ)gstrans.$(OBJ) : $(GLSRC)gstrans.c $(GXERR)\ + $(math__h) $(memory__h) $(gdevp14_h) $(gstrans_h)\ +- $(gsutil_h) $(gxdevcli_h) $(gzstate_h) $(gscspace_h) ++ $(gsutil_h) $(gxdevcli_h) $(gzstate_h) $(gscspace_h)\ ++ $(gxclist_h) + $(GLCC) $(GLO_)gstrans.$(OBJ) $(C_) $(GLSRC)gstrans.c + + $(GLOBJ)gximag3x.$(OBJ) : $(GLSRC)gximag3x.c $(GXERR) $(math__h) $(memory__h)\ --- ghostscript-8.71.dfsg.1.orig/debian/patches/pdf2dsc-fix-for-pdflatex-preview.dpatch +++ ghostscript-8.71.dfsg.1/debian/patches/pdf2dsc-fix-for-pdflatex-preview.dpatch @@ -0,0 +1,24 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## Description: Fix PDF trailer attributes undefined error +## Update pdf2dsc.ps to match the changes in pdf_main.ps introduced by +## the rev. 10341. Thanks to William Bader for the patch. +## Origin: http://svn.ghostscript.com/viewvc?view=rev&revision=10778 +## Author: Alex Cherepanov +## Bug: http://bugs.ghostscript.com/show_bug.cgi?id=691124 +## Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/ghostscript/+bug/543266 +## Forwarded: yes +## Last-Update: 2010-02-28 + +@DPATCH@ +diff -urNad ghostscript~/lib/pdf2dsc.ps ghostscript/lib/pdf2dsc.ps +--- ghostscript~/lib/pdf2dsc.ps 2010-04-02 00:01:11.000000000 +0100 ++++ ghostscript/lib/pdf2dsc.ps 2010-04-02 08:24:56.430323772 +0100 +@@ -116,7 +116,7 @@ + DSCfile PDFname write==only + ( \(r\) file { DELAYSAFER { .setsafe } if } stopped pop\n) puts + ( pdfopen begin\n) puts +- ( copy_trailer_attrs\n) puts ++ ( process_trailer_attrs\n) puts + (%%EndSetup\n) puts + + /.hasPageLabels false def % see "Page Labels" in the PDF Reference --- ghostscript-8.71.dfsg.1.orig/debian/patches/fapi-buildchar-object-null-check.dpatch +++ ghostscript-8.71.dfsg.1/debian/patches/fapi-buildchar-object-null-check.dpatch @@ -0,0 +1,19 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## fapi-buildchar-object-null-check.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad ghostscript-8.71.dfsg.1~/psi/zfapi.c ghostscript-8.71.dfsg.1/psi/zfapi.c +--- ghostscript-8.71.dfsg.1~/psi/zfapi.c 2010-01-28 15:44:22.000000000 +0100 ++++ ghostscript-8.71.dfsg.1/psi/zfapi.c 2010-04-29 09:30:09.789834388 +0200 +@@ -1311,7 +1311,7 @@ + } else + if ((code = build_proc_name_refs(imemory, &build, ".FAPIBuildChar", ".FAPIBuildGlyph")) < 0) + return code; +- if (pdata->BuildChar.value.pname && build.BuildChar.value.pname && ++ if (r_type(&(pdata->BuildChar)) != t_null && pdata->BuildChar.value.pname && build.BuildChar.value.pname && + name_index(imemory, &pdata->BuildChar) == name_index(imemory, &build.BuildChar)) { + /* Already rebuilt - maybe a substituted font. */ + } else { --- ghostscript-8.71.dfsg.1.orig/debian/patches/CVE-2010-1628.dpatch +++ ghostscript-8.71.dfsg.1/debian/patches/CVE-2010-1628.dpatch @@ -0,0 +1,133 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +# Description: fix arbitrary code execution via unlimited recursive +# procedure invocations +# Origin: upstream, http://svn.ghostscript.com/viewvc?view=rev&revision=11414 +# Bug: http://bugs.ghostscript.com/show_bug.cgi?id=691295 +# Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/ghostscript/+bug/546009 +# Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=584516 + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/psi/ialloc.c ghostscript-8.71.dfsg.1/psi/ialloc.c +--- ghostscript-8.71.dfsg.1~/psi/ialloc.c 2008-08-28 18:48:19.000000000 -0400 ++++ ghostscript-8.71.dfsg.1/psi/ialloc.c 2010-07-09 08:05:28.000000000 -0400 +@@ -185,7 +185,14 @@ + */ + chunk_t *pcc = mem->pcc; + ref *end; ++ alloc_change_t *cp = 0; ++ int code = 0; + ++ if ((gs_memory_t *)mem != mem->stable_memory) { ++ code = alloc_save_change_alloc(mem, "gs_alloc_ref_array", &cp); ++ if (code < 0) ++ return code; ++ } + obj = gs_alloc_struct_array((gs_memory_t *) mem, num_refs + 1, + ref, &st_refs, cname); + if (obj == 0) +@@ -210,14 +217,10 @@ + chunk_locate_ptr(obj, &cl); + cl.cp->has_refs = true; + } +- if ((gs_memory_t *)mem != mem->stable_memory) { +- ref_packed **ppr = 0; +- int code = alloc_save_change_alloc(mem, "gs_alloc_ref_array", &ppr); +- if (code < 0) +- return code; +- if (ppr) +- *ppr = (ref_packed *)obj; +- } ++ if (cp) { ++ mem->changes = cp; ++ cp->where = (ref_packed *)obj; ++ } + } + make_array(parr, attrs | mem->space, num_refs, obj); + return 0; +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/psi/idosave.h ghostscript-8.71.dfsg.1/psi/idosave.h +--- ghostscript-8.71.dfsg.1~/psi/idosave.h 2008-08-28 18:48:19.000000000 -0400 ++++ ghostscript-8.71.dfsg.1/psi/idosave.h 2010-07-09 08:05:31.000000000 -0400 +@@ -18,6 +18,22 @@ + # define idosave_INCLUDED + + /* ++ * Structure for saved change chain for save/restore. Because of the ++ * garbage collector, we need to distinguish the cases where the change ++ * is in a static object, a dynamic ref, or a dynamic struct. ++ */ ++typedef struct alloc_change_s alloc_change_t; ++struct alloc_change_s { ++ alloc_change_t *next; ++ ref_packed *where; ++ ref contents; ++#define AC_OFFSET_STATIC (-2) /* static object */ ++#define AC_OFFSET_REF (-1) /* dynamic ref */ ++#define AC_OFFSET_ALLOCATED (-3) /* a newly allocated ref array */ ++ short offset; /* if >= 0, offset within struct */ ++}; ++ ++/* + * Save a change that must be undone by restore. We have to pass the + * pointer to the containing object to alloc_save_change for two reasons: + * +@@ -29,6 +45,7 @@ + * relocate the pointer to it from the change record during garbage + * collection. + */ ++ + int alloc_save_change(gs_dual_memory_t *dmem, const ref *pcont, + ref_packed *ptr, client_name_t cname); + int alloc_save_change_in(gs_ref_memory_t *mem, const ref *pcont, +@@ -36,6 +53,6 @@ + /* Remove an AC_OFFSET_ALLOCATED element. */ + void alloc_save_remove(gs_ref_memory_t *mem, ref_packed *obj, client_name_t cname); + /* Allocate a structure for recording an allocation event. */ +-int alloc_save_change_alloc(gs_ref_memory_t *mem, client_name_t cname, ref_packed ***ppr); ++int alloc_save_change_alloc(gs_ref_memory_t *mem, client_name_t cname, alloc_change_t **pcp); + + #endif /* idosave_INCLUDED */ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/psi/isave.c ghostscript-8.71.dfsg.1/psi/isave.c +--- ghostscript-8.71.dfsg.1~/psi/isave.c 2008-08-28 18:48:19.000000000 -0400 ++++ ghostscript-8.71.dfsg.1/psi/isave.c 2010-07-09 08:05:33.000000000 -0400 +@@ -156,22 +156,6 @@ + /* A link to igcref.c . */ + ptr_proc_reloc(igc_reloc_ref_ptr_nocheck, ref_packed); + +-/* +- * Structure for saved change chain for save/restore. Because of the +- * garbage collector, we need to distinguish the cases where the change +- * is in a static object, a dynamic ref, or a dynamic struct. +- */ +-typedef struct alloc_change_s alloc_change_t; +-struct alloc_change_s { +- alloc_change_t *next; +- ref_packed *where; +- ref contents; +-#define AC_OFFSET_STATIC (-2) /* static object */ +-#define AC_OFFSET_REF (-1) /* dynamic ref */ +-#define AC_OFFSET_ALLOCATED (-3) /* a newly allocated ref array */ +- short offset; /* if >= 0, offset within struct */ +-}; +- + static + CLEAR_MARKS_PROC(change_clear_marks) + { +@@ -519,7 +503,7 @@ + + /* Allocate a structure for recording an allocation event. */ + int +-alloc_save_change_alloc(gs_ref_memory_t *mem, client_name_t cname, ref_packed ***ppr) ++alloc_save_change_alloc(gs_ref_memory_t *mem, client_name_t cname, alloc_change_t **pcp) + { + register alloc_change_t *cp; + +@@ -533,8 +517,7 @@ + cp->where = 0; + cp->offset = AC_OFFSET_ALLOCATED; + make_null(&cp->contents); +- mem->changes = cp; +- *ppr = &cp->where; ++ *pcp = cp; + return 1; + } + --- ghostscript-8.71.dfsg.1.orig/debian/patches/CVE-2008-352x.dpatch +++ ghostscript-8.71.dfsg.1/debian/patches/CVE-2008-352x.dpatch @@ -0,0 +1,851 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +# Description: fix integer overflows via integer multiplication for +# memory allocation and buffer overflow via vsprintf in jas_stream_printf() +# Origin: backported from recent jasper packages + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/base/jas_cm.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/base/jas_cm.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/base/jas_cm.c 2009-02-16 15:00:17.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/base/jas_cm.c 2011-12-20 15:43:50.874307929 -0500 +@@ -810,8 +810,7 @@ + { + jas_cmpxform_t **p; + assert(n >= pxformseq->numpxforms); +- p = (!pxformseq->pxforms) ? jas_malloc(n * sizeof(jas_cmpxform_t *)) : +- jas_realloc(pxformseq->pxforms, n * sizeof(jas_cmpxform_t *)); ++ p = jas_realloc2(pxformseq->pxforms, n, sizeof(jas_cmpxform_t *)); + if (!p) { + return -1; + } +@@ -995,13 +994,13 @@ + jas_cmshapmatlut_cleanup(lut); + if (curv->numents == 0) { + lut->size = 2; +- if (!(lut->data = jas_malloc(lut->size * sizeof(jas_cmreal_t)))) ++ if (!(lut->data = jas_alloc2(lut->size, sizeof(jas_cmreal_t)))) + goto error; + lut->data[0] = 0.0; + lut->data[1] = 1.0; + } else if (curv->numents == 1) { + lut->size = 256; +- if (!(lut->data = jas_malloc(lut->size * sizeof(jas_cmreal_t)))) ++ if (!(lut->data = jas_alloc2(lut->size, sizeof(jas_cmreal_t)))) + goto error; + gamma = curv->ents[0] / 256.0; + for (i = 0; i < lut->size; ++i) { +@@ -1009,7 +1008,7 @@ + } + } else { + lut->size = curv->numents; +- if (!(lut->data = jas_malloc(lut->size * sizeof(jas_cmreal_t)))) ++ if (!(lut->data = jas_alloc2(lut->size, sizeof(jas_cmreal_t)))) + goto error; + for (i = 0; i < lut->size; ++i) { + lut->data[i] = curv->ents[i] / 65535.0; +@@ -1059,7 +1058,7 @@ + return -1; + } + } +- if (!(invlut->data = jas_malloc(n * sizeof(jas_cmreal_t)))) ++ if (!(invlut->data = jas_alloc2(n, sizeof(jas_cmreal_t)))) + return -1; + invlut->size = n; + for (i = 0; i < invlut->size; ++i) { +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/base/jas_icc.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/base/jas_icc.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/base/jas_icc.c 2009-02-16 15:00:17.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/base/jas_icc.c 2011-12-20 15:43:50.874307929 -0500 +@@ -376,7 +376,7 @@ + jas_icctagtab_t *tagtab; + + tagtab = &prof->tagtab; +- if (!(tagtab->ents = jas_malloc(prof->attrtab->numattrs * ++ if (!(tagtab->ents = jas_alloc2(prof->attrtab->numattrs, + sizeof(jas_icctagtabent_t)))) + goto error; + tagtab->numents = prof->attrtab->numattrs; +@@ -525,7 +525,7 @@ + } + if (jas_iccgetuint32(in, &tagtab->numents)) + goto error; +- if (!(tagtab->ents = jas_malloc(tagtab->numents * ++ if (!(tagtab->ents = jas_alloc2(tagtab->numents, + sizeof(jas_icctagtabent_t)))) + goto error; + tagtabent = tagtab->ents; +@@ -750,8 +750,7 @@ + { + jas_iccattr_t *newattrs; + assert(maxents >= tab->numattrs); +- newattrs = tab->attrs ? jas_realloc(tab->attrs, maxents * +- sizeof(jas_iccattr_t)) : jas_malloc(maxents * sizeof(jas_iccattr_t)); ++ newattrs = jas_realloc2(tab->attrs, maxents, sizeof(jas_iccattr_t)); + if (!newattrs) + return -1; + tab->attrs = newattrs; +@@ -1012,7 +1011,7 @@ + + if (jas_iccgetuint32(in, &curv->numents)) + goto error; +- if (!(curv->ents = jas_malloc(curv->numents * sizeof(jas_iccuint16_t)))) ++ if (!(curv->ents = jas_alloc2(curv->numents, sizeof(jas_iccuint16_t)))) + goto error; + for (i = 0; i < curv->numents; ++i) { + if (jas_iccgetuint16(in, &curv->ents[i])) +@@ -1115,7 +1114,7 @@ + if (jas_iccgetuint32(in, &txtdesc->uclangcode) || + jas_iccgetuint32(in, &txtdesc->uclen)) + goto error; +- if (!(txtdesc->ucdata = jas_malloc(txtdesc->uclen * 2))) ++ if (!(txtdesc->ucdata = jas_alloc2(txtdesc->uclen, 2))) + goto error; + if (jas_stream_read(in, txtdesc->ucdata, txtdesc->uclen * 2) != + JAS_CAST(int, txtdesc->uclen * 2)) +@@ -1311,17 +1310,17 @@ + jas_iccgetuint16(in, &lut8->numouttabents)) + goto error; + clutsize = jas_iccpowi(lut8->clutlen, lut8->numinchans) * lut8->numoutchans; +- if (!(lut8->clut = jas_malloc(clutsize * sizeof(jas_iccuint8_t))) || +- !(lut8->intabsbuf = jas_malloc(lut8->numinchans * +- lut8->numintabents * sizeof(jas_iccuint8_t))) || +- !(lut8->intabs = jas_malloc(lut8->numinchans * ++ if (!(lut8->clut = jas_alloc2(clutsize, sizeof(jas_iccuint8_t))) || ++ !(lut8->intabsbuf = jas_alloc3(lut8->numinchans, ++ lut8->numintabents, sizeof(jas_iccuint8_t))) || ++ !(lut8->intabs = jas_alloc2(lut8->numinchans, + sizeof(jas_iccuint8_t *)))) + goto error; + for (i = 0; i < lut8->numinchans; ++i) + lut8->intabs[i] = &lut8->intabsbuf[i * lut8->numintabents]; +- if (!(lut8->outtabsbuf = jas_malloc(lut8->numoutchans * +- lut8->numouttabents * sizeof(jas_iccuint8_t))) || +- !(lut8->outtabs = jas_malloc(lut8->numoutchans * ++ if (!(lut8->outtabsbuf = jas_alloc3(lut8->numoutchans, ++ lut8->numouttabents, sizeof(jas_iccuint8_t))) || ++ !(lut8->outtabs = jas_alloc2(lut8->numoutchans, + sizeof(jas_iccuint8_t *)))) + goto error; + for (i = 0; i < lut8->numoutchans; ++i) +@@ -1482,17 +1481,17 @@ + jas_iccgetuint16(in, &lut16->numouttabents)) + goto error; + clutsize = jas_iccpowi(lut16->clutlen, lut16->numinchans) * lut16->numoutchans; +- if (!(lut16->clut = jas_malloc(clutsize * sizeof(jas_iccuint16_t))) || +- !(lut16->intabsbuf = jas_malloc(lut16->numinchans * +- lut16->numintabents * sizeof(jas_iccuint16_t))) || +- !(lut16->intabs = jas_malloc(lut16->numinchans * ++ if (!(lut16->clut = jas_alloc2(clutsize, sizeof(jas_iccuint16_t))) || ++ !(lut16->intabsbuf = jas_alloc3(lut16->numinchans, ++ lut16->numintabents, sizeof(jas_iccuint16_t))) || ++ !(lut16->intabs = jas_alloc2(lut16->numinchans, + sizeof(jas_iccuint16_t *)))) + goto error; + for (i = 0; i < lut16->numinchans; ++i) + lut16->intabs[i] = &lut16->intabsbuf[i * lut16->numintabents]; +- if (!(lut16->outtabsbuf = jas_malloc(lut16->numoutchans * +- lut16->numouttabents * sizeof(jas_iccuint16_t))) || +- !(lut16->outtabs = jas_malloc(lut16->numoutchans * ++ if (!(lut16->outtabsbuf = jas_alloc3(lut16->numoutchans, ++ lut16->numouttabents, sizeof(jas_iccuint16_t))) || ++ !(lut16->outtabs = jas_alloc2(lut16->numoutchans, + sizeof(jas_iccuint16_t *)))) + goto error; + for (i = 0; i < lut16->numoutchans; ++i) +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/base/jas_image.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/base/jas_image.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/base/jas_image.c 2009-02-16 15:00:17.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/base/jas_image.c 2011-12-20 15:43:50.874307929 -0500 +@@ -144,7 +144,7 @@ + image->inmem_ = jas_true; + + /* Allocate memory for the per-component information. */ +- if (!(image->cmpts_ = jas_malloc(image->maxcmpts_ * ++ if (!(image->cmpts_ = jas_alloc2(image->maxcmpts_, + sizeof(jas_image_cmpt_t *)))) { + jas_image_destroy(image); + return 0; +@@ -790,8 +790,7 @@ + jas_image_cmpt_t **newcmpts; + int cmptno; + +- newcmpts = (!image->cmpts_) ? jas_malloc(maxcmpts * sizeof(jas_image_cmpt_t *)) : +- jas_realloc(image->cmpts_, maxcmpts * sizeof(jas_image_cmpt_t *)); ++ newcmpts = jas_realloc2(image->cmpts_, maxcmpts, sizeof(jas_image_cmpt_t *)); + if (!newcmpts) { + return -1; + } +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/base/jas_malloc.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/base/jas_malloc.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/base/jas_malloc.c 2009-02-16 15:00:17.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/base/jas_malloc.c 2011-12-20 15:43:50.874307929 -0500 +@@ -75,6 +75,9 @@ + + /* We need the prototype for memset. */ + #include ++#include ++#include ++#include + + #include "jasper/jas_malloc.h" + +@@ -186,20 +189,52 @@ + removeMem(ptr); + if(size == 0) + size = 1; +- p = realloc(ptr, size); ++ p = ptr ? realloc(ptr, size) : malloc(size); + addMem(p); + return p; + } + +-void *jas_calloc(size_t nmemb, size_t size) ++void *jas_realloc2(void *ptr, size_t nmemb, size_t size) ++{ ++ if (!ptr) ++ return jas_alloc2(nmemb, size); ++ if (nmemb && SIZE_MAX / nmemb < size) { ++ errno = ENOMEM; ++ return NULL; ++ } ++ return jas_realloc(ptr, nmemb * size); ++ ++} ++ ++void *jas_alloc2(size_t nmemb, size_t size) ++{ ++ if (nmemb && SIZE_MAX / nmemb < size) { ++ errno = ENOMEM; ++ return NULL; ++ } ++ ++ return jas_malloc(nmemb * size); ++} ++ ++void *jas_alloc3(size_t a, size_t b, size_t c) + { +- void *ptr; + size_t n; +- n = nmemb * size; +- if (!(ptr = jas_malloc(n * sizeof(char)))) { +- return 0; ++ ++ if (a && SIZE_MAX / a < b) { ++ errno = ENOMEM; ++ return NULL; + } +- memset(ptr, 0, n); ++ ++ return jas_alloc2(a*b, c); ++} ++ ++void *jas_calloc(size_t nmemb, size_t size) ++{ ++ void *ptr; ++ ++ ptr = jas_alloc2(nmemb, size); ++ if (ptr) ++ memset(ptr, 0, nmemb*size); + return ptr; + } + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/base/jas_seq.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/base/jas_seq.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/base/jas_seq.c 2009-02-16 15:00:17.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/base/jas_seq.c 2011-12-20 15:43:50.874307929 -0500 +@@ -114,7 +114,7 @@ + matrix->datasize_ = numrows * numcols; + + if (matrix->maxrows_ > 0) { +- if (!(matrix->rows_ = jas_malloc(matrix->maxrows_ * ++ if (!(matrix->rows_ = jas_alloc2(matrix->maxrows_, + sizeof(jas_seqent_t *)))) { + jas_matrix_destroy(matrix); + return 0; +@@ -122,7 +122,7 @@ + } + + if (matrix->datasize_ > 0) { +- if (!(matrix->data_ = jas_malloc(matrix->datasize_ * ++ if (!(matrix->data_ = jas_alloc2(matrix->datasize_, + sizeof(jas_seqent_t)))) { + jas_matrix_destroy(matrix); + return 0; +@@ -220,7 +220,7 @@ + mat0->numrows_ = r1 - r0 + 1; + mat0->numcols_ = c1 - c0 + 1; + mat0->maxrows_ = mat0->numrows_; +- mat0->rows_ = jas_malloc(mat0->maxrows_ * sizeof(jas_seqent_t *)); ++ mat0->rows_ = jas_alloc2(mat0->maxrows_, sizeof(jas_seqent_t *)); + for (i = 0; i < mat0->numrows_; ++i) { + mat0->rows_[i] = mat1->rows_[r0 + i] + c0; + } +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/base/jas_stream.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/base/jas_stream.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/base/jas_stream.c 2009-02-16 15:00:17.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/base/jas_stream.c 2011-12-20 15:43:50.878307929 -0500 +@@ -215,7 +215,7 @@ + if (buf) { + obj->buf_ = (unsigned char *) buf; + } else { +- obj->buf_ = jas_malloc(obj->bufsize_ * sizeof(char)); ++ obj->buf_ = jas_malloc(obj->bufsize_); + obj->myalloc_ = 1; + } + if (!obj->buf_) { +@@ -568,7 +568,7 @@ + int ret; + + va_start(ap, fmt); +- ret = vsprintf(buf, fmt, ap); ++ ret = vsnprintf(buf, sizeof buf, fmt, ap); + jas_stream_puts(stream, buf); + va_end(ap); + return ret; +@@ -1027,7 +1027,7 @@ + unsigned char *buf; + + assert(m->buf_); +- if (!(buf = jas_realloc(m->buf_, bufsize * sizeof(unsigned char)))) { ++ if (!(buf = jas_realloc(m->buf_, bufsize))) { + return -1; + } + m->buf_ = buf; +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/bmp/bmp_dec.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/bmp/bmp_dec.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/bmp/bmp_dec.c 2009-02-16 15:00:17.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/bmp/bmp_dec.c 2011-12-20 15:43:50.878307929 -0500 +@@ -284,7 +284,7 @@ + } + + if (info->numcolors > 0) { +- if (!(info->palents = jas_malloc(info->numcolors * ++ if (!(info->palents = jas_alloc2(info->numcolors, + sizeof(bmp_palent_t)))) { + bmp_info_destroy(info); + return 0; +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/include/jasper/jas_malloc.h ghostscript-8.71.dfsg.1/jasper/src/libjasper/include/jasper/jas_malloc.h +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/include/jasper/jas_malloc.h 2009-02-16 15:00:17.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/include/jasper/jas_malloc.h 2011-12-20 15:43:50.878307929 -0500 +@@ -95,6 +95,9 @@ + #define jas_free MEMFREE + #define jas_realloc MEMREALLOC + #define jas_calloc MEMCALLOC ++#define jas_alloc2(a, b) MEMALLOC((a)*(b)) ++#define jas_alloc3(a, b, c) MEMALLOC((a)*(b)*(c)) ++#define jas_realloc2(p, a, b) MEMREALLOC((p), (a)*(b)) + #endif + + /******************************************************************************\ +@@ -115,6 +118,12 @@ + /* Allocate a block of memory and initialize the contents to zero. */ + void *jas_calloc(size_t nmemb, size_t size); + ++/* size-checked double allocation .*/ ++void *jas_alloc2(size_t, size_t); ++ ++void *jas_alloc3(size_t, size_t, size_t); ++ ++void *jas_realloc2(void *, size_t, size_t); + #endif + + #ifdef __cplusplus +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jp2/jp2_cod.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/jp2/jp2_cod.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jp2/jp2_cod.c 2009-02-16 15:00:17.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/jp2/jp2_cod.c 2011-12-20 15:43:50.878307929 -0500 +@@ -363,7 +363,7 @@ + jp2_bpcc_t *bpcc = &box->data.bpcc; + unsigned int i; + bpcc->numcmpts = box->len - JP2_BOX_HDRLEN; +- if (!(bpcc->bpcs = jas_malloc(bpcc->numcmpts * sizeof(uint_fast8_t)))) { ++ if (!(bpcc->bpcs = jas_alloc2(bpcc->numcmpts, sizeof(uint_fast8_t)))) { + return -1; + } + for (i = 0; i < bpcc->numcmpts; ++i) { +@@ -407,7 +407,7 @@ + break; + case JP2_COLR_ICC: + colr->iccplen = box->len - JP2_BOX_HDRLEN - 3; +- if (!(colr->iccp = jas_malloc(colr->iccplen * sizeof(uint_fast8_t)))) { ++ if (!(colr->iccp = jas_alloc2(colr->iccplen, sizeof(uint_fast8_t)))) { + return -1; + } + if (jas_stream_read(in, colr->iccp, colr->iccplen) != colr->iccplen) { +@@ -444,7 +444,7 @@ + if (jp2_getuint16(in, &cdef->numchans)) { + return -1; + } +- if (!(cdef->ents = jas_malloc(cdef->numchans * sizeof(jp2_cdefchan_t)))) { ++ if (!(cdef->ents = jas_alloc2(cdef->numchans, sizeof(jp2_cdefchan_t)))) { + return -1; + } + for (channo = 0; channo < cdef->numchans; ++channo) { +@@ -752,7 +752,7 @@ + unsigned int i; + + cmap->numchans = (box->len - JP2_BOX_HDRLEN) / 4; +- if (!(cmap->ents = jas_malloc(cmap->numchans * sizeof(jp2_cmapent_t)))) { ++ if (!(cmap->ents = jas_alloc2(cmap->numchans, sizeof(jp2_cmapent_t)))) { + return -1; + } + for (i = 0; i < cmap->numchans; ++i) { +@@ -814,10 +814,10 @@ + return -1; + } + lutsize = pclr->numlutents * pclr->numchans; +- if (!(pclr->lutdata = jas_malloc(lutsize * sizeof(int_fast32_t)))) { ++ if (!(pclr->lutdata = jas_alloc2(lutsize, sizeof(int_fast32_t)))) { + return -1; + } +- if (!(pclr->bpc = jas_malloc(pclr->numchans * sizeof(uint_fast8_t)))) { ++ if (!(pclr->bpc = jas_alloc2(pclr->numchans, sizeof(uint_fast8_t)))) { + return -1; + } + for (i = 0; i < pclr->numchans; ++i) { +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jp2/jp2_dec.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/jp2/jp2_dec.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jp2/jp2_dec.c 2009-02-16 15:00:17.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/jp2/jp2_dec.c 2011-12-20 15:43:50.878307929 -0500 +@@ -379,7 +379,7 @@ + } + + /* Allocate space for the channel-number to component-number LUT. */ +- if (!(dec->chantocmptlut = jas_malloc(dec->numchans * sizeof(uint_fast16_t)))) { ++ if (!(dec->chantocmptlut = jas_alloc2(dec->numchans, sizeof(uint_fast16_t)))) { + jas_eprintf("error: no memory\n"); + goto error; + } +@@ -404,7 +404,7 @@ + #endif + } else if (cmapent->map == JP2_CMAP_PALETTE) { + if (!decopts.raw) { +- lutents = jas_malloc(pclrd->numlutents * sizeof(int_fast32_t)); ++ lutents = jas_alloc2(pclrd->numlutents, sizeof(int_fast32_t)); + for (i = 0; i < pclrd->numlutents; ++i) { + lutents[i] = pclrd->lutdata[cmapent->pcol + i * pclrd->numchans]; + } +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jp2/jp2_enc.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/jp2/jp2_enc.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jp2/jp2_enc.c 2009-02-16 15:00:17.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/jp2/jp2_enc.c 2011-12-20 15:43:50.878307929 -0500 +@@ -193,7 +193,7 @@ + } + bpcc = &box->data.bpcc; + bpcc->numcmpts = jas_image_numcmpts(image); +- if (!(bpcc->bpcs = jas_malloc(bpcc->numcmpts * ++ if (!(bpcc->bpcs = jas_alloc2(bpcc->numcmpts, + sizeof(uint_fast8_t)))) { + goto error; + } +@@ -305,7 +305,7 @@ + } + cdef = &box->data.cdef; + cdef->numchans = jas_image_numcmpts(image); +- cdef->ents = jas_malloc(cdef->numchans * sizeof(jp2_cdefchan_t)); ++ cdef->ents = jas_alloc2(cdef->numchans, sizeof(jp2_cdefchan_t)); + for (i = 0; i < jas_image_numcmpts(image); ++i) { + cdefchanent = &cdef->ents[i]; + cdefchanent->channo = i; +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_cs.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_cs.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_cs.c 2009-02-16 15:00:17.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_cs.c 2011-12-20 15:43:50.878307929 -0500 +@@ -507,7 +507,7 @@ + !siz->tileheight || !siz->numcomps) { + return -1; + } +- if (!(siz->comps = jas_malloc(siz->numcomps * sizeof(jpc_sizcomp_t)))) { ++ if (!(siz->comps = jas_alloc2(siz->numcomps, sizeof(jpc_sizcomp_t)))) { + return -1; + } + for (i = 0; i < siz->numcomps; ++i) { +@@ -1103,7 +1103,7 @@ + + ppm->len = ms->len - 1; + if (ppm->len > 0) { +- if (!(ppm->data = jas_malloc(ppm->len * sizeof(unsigned char)))) { ++ if (!(ppm->data = jas_malloc(ppm->len))) { + goto error; + } + if (JAS_CAST(uint, jas_stream_read(in, ppm->data, ppm->len)) != ppm->len) { +@@ -1172,7 +1172,7 @@ + } + ppt->len = ms->len - 1; + if (ppt->len > 0) { +- if (!(ppt->data = jas_malloc(ppt->len * sizeof(unsigned char)))) { ++ if (!(ppt->data = jas_malloc(ppt->len))) { + goto error; + } + if (jas_stream_read(in, (char *) ppt->data, ppt->len) != JAS_CAST(int, ppt->len)) { +@@ -1235,7 +1235,7 @@ + uint_fast8_t tmp; + poc->numpchgs = (cstate->numcomps > 256) ? (ms->len / 9) : + (ms->len / 7); +- if (!(poc->pchgs = jas_malloc(poc->numpchgs * sizeof(jpc_pocpchg_t)))) { ++ if (!(poc->pchgs = jas_alloc2(poc->numpchgs, sizeof(jpc_pocpchg_t)))) { + goto error; + } + for (pchgno = 0, pchg = poc->pchgs; pchgno < poc->numpchgs; ++pchgno, +@@ -1340,7 +1340,7 @@ + jpc_crgcomp_t *comp; + uint_fast16_t compno; + crg->numcomps = cstate->numcomps; +- if (!(crg->comps = jas_malloc(cstate->numcomps * sizeof(uint_fast16_t)))) { ++ if (!(crg->comps = jas_alloc2(cstate->numcomps, sizeof(uint_fast16_t)))) { + return -1; + } + for (compno = 0, comp = crg->comps; compno < cstate->numcomps; +@@ -1479,7 +1479,7 @@ + cstate = 0; + + if (ms->len > 0) { +- if (!(unk->data = jas_malloc(ms->len * sizeof(unsigned char)))) { ++ if (!(unk->data = jas_malloc(ms->len))) { + return -1; + } + if (jas_stream_read(in, (char *) unk->data, ms->len) != JAS_CAST(int, ms->len)) { +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_dec.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_dec.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_dec.c 2009-02-16 15:00:17.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_dec.c 2011-12-20 15:43:50.878307929 -0500 +@@ -454,7 +454,7 @@ + + if (dec->state == JPC_MH) { + +- compinfos = jas_malloc(dec->numcomps * sizeof(jas_image_cmptparm_t)); ++ compinfos = jas_alloc2(dec->numcomps, sizeof(jas_image_cmptparm_t)); + assert(compinfos); + for (cmptno = 0, cmpt = dec->cmpts, compinfo = compinfos; + cmptno < dec->numcomps; ++cmptno, ++cmpt, ++compinfo) { +@@ -704,7 +704,7 @@ + tile->realmode = 1; + } + tcomp->numrlvls = ccp->numrlvls; +- if (!(tcomp->rlvls = jas_malloc(tcomp->numrlvls * ++ if (!(tcomp->rlvls = jas_alloc2(tcomp->numrlvls, + sizeof(jpc_dec_rlvl_t)))) { + return -1; + } +@@ -776,7 +776,7 @@ + rlvl->cbgheightexpn); + + rlvl->numbands = (!rlvlno) ? 1 : 3; +- if (!(rlvl->bands = jas_malloc(rlvl->numbands * ++ if (!(rlvl->bands = jas_alloc2(rlvl->numbands, + sizeof(jpc_dec_band_t)))) { + return -1; + } +@@ -809,7 +809,7 @@ + + assert(rlvl->numprcs); + +- if (!(band->prcs = jas_malloc(rlvl->numprcs * sizeof(jpc_dec_prc_t)))) { ++ if (!(band->prcs = jas_alloc2(rlvl->numprcs, sizeof(jpc_dec_prc_t)))) { + return -1; + } + +@@ -846,7 +846,7 @@ + if (!(prc->numimsbstagtree = jpc_tagtree_create(prc->numhcblks, prc->numvcblks))) { + return -1; + } +- if (!(prc->cblks = jas_malloc(prc->numcblks * sizeof(jpc_dec_cblk_t)))) { ++ if (!(prc->cblks = jas_alloc2(prc->numcblks, sizeof(jpc_dec_cblk_t)))) { + return -1; + } + +@@ -1196,7 +1196,7 @@ + return -1; + } + +- if (!(dec->cmpts = jas_malloc(dec->numcomps * sizeof(jpc_dec_cmpt_t)))) { ++ if (!(dec->cmpts = jas_alloc2(dec->numcomps, sizeof(jpc_dec_cmpt_t)))) { + return -1; + } + +@@ -1507,7 +1507,7 @@ + cp->numlyrs = 0; + cp->mctid = 0; + cp->csty = 0; +- if (!(cp->ccps = jas_malloc(cp->numcomps * sizeof(jpc_dec_ccp_t)))) { ++ if (!(cp->ccps = jas_alloc2(cp->numcomps, sizeof(jpc_dec_ccp_t)))) { + return 0; + } + if (!(cp->pchglist = jpc_pchglist_create())) { +@@ -2071,7 +2071,7 @@ + } + streamlist->numstreams = 0; + streamlist->maxstreams = 100; +- if (!(streamlist->streams = jas_malloc(streamlist->maxstreams * ++ if (!(streamlist->streams = jas_alloc2(streamlist->maxstreams, + sizeof(jas_stream_t *)))) { + jas_free(streamlist); + return 0; +@@ -2091,8 +2091,8 @@ + /* Grow the array of streams if necessary. */ + if (streamlist->numstreams >= streamlist->maxstreams) { + newmaxstreams = streamlist->maxstreams + 1024; +- if (!(newstreams = jas_realloc(streamlist->streams, +- (newmaxstreams + 1024) * sizeof(jas_stream_t *)))) { ++ if (!(newstreams = jas_realloc2(streamlist->streams, ++ (newmaxstreams + 1024), sizeof(jas_stream_t *)))) { + return -1; + } + for (i = streamlist->numstreams; i < streamlist->maxstreams; ++i) { +@@ -2182,8 +2182,7 @@ + { + jpc_ppxstabent_t **newents; + if (tab->maxents < maxents) { +- newents = (tab->ents) ? jas_realloc(tab->ents, maxents * +- sizeof(jpc_ppxstabent_t *)) : jas_malloc(maxents * sizeof(jpc_ppxstabent_t *)); ++ newents = jas_realloc2(tab->ents, maxents, sizeof(jpc_ppxstabent_t *)); + if (!newents) { + return -1; + } +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_enc.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_enc.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_enc.c 2009-02-16 15:00:17.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_enc.c 2011-12-20 15:43:50.878307929 -0500 +@@ -408,7 +408,7 @@ + vsteplcm *= jas_image_cmptvstep(image, cmptno); + } + +- if (!(cp->ccps = jas_malloc(cp->numcmpts * sizeof(jpc_enc_ccp_t)))) { ++ if (!(cp->ccps = jas_alloc2(cp->numcmpts, sizeof(jpc_enc_ccp_t)))) { + goto error; + } + for (cmptno = 0, ccp = cp->ccps; cmptno < JAS_CAST(int, cp->numcmpts); ++cmptno, +@@ -665,7 +665,7 @@ + + if (ilyrrates && numilyrrates > 0) { + tcp->numlyrs = numilyrrates + 1; +- if (!(tcp->ilyrrates = jas_malloc((tcp->numlyrs - 1) * ++ if (!(tcp->ilyrrates = jas_alloc2((tcp->numlyrs - 1), + sizeof(jpc_fix_t)))) { + goto error; + } +@@ -949,7 +949,7 @@ + siz->tilewidth = cp->tilewidth; + siz->tileheight = cp->tileheight; + siz->numcomps = cp->numcmpts; +- siz->comps = jas_malloc(siz->numcomps * sizeof(jpc_sizcomp_t)); ++ siz->comps = jas_alloc2(siz->numcomps, sizeof(jpc_sizcomp_t)); + assert(siz->comps); + for (i = 0; i < JAS_CAST(int, cp->numcmpts); ++i) { + siz->comps[i].prec = cp->ccps[i].prec; +@@ -990,7 +990,7 @@ + return -1; + } + crg = &enc->mrk->parms.crg; +- crg->comps = jas_malloc(crg->numcomps * sizeof(jpc_crgcomp_t)); ++ crg->comps = jas_alloc2(crg->numcomps, sizeof(jpc_crgcomp_t)); + if (jpc_putms(enc->out, enc->cstate, enc->mrk)) { + jas_eprintf("cannot write CRG marker\n"); + return -1; +@@ -1989,7 +1989,7 @@ + tile->mctid = cp->tcp.mctid; + + tile->numlyrs = cp->tcp.numlyrs; +- if (!(tile->lyrsizes = jas_malloc(tile->numlyrs * ++ if (!(tile->lyrsizes = jas_alloc2(tile->numlyrs, + sizeof(uint_fast32_t)))) { + goto error; + } +@@ -1998,7 +1998,7 @@ + } + + /* Allocate an array for the per-tile-component information. */ +- if (!(tile->tcmpts = jas_malloc(cp->numcmpts * sizeof(jpc_enc_tcmpt_t)))) { ++ if (!(tile->tcmpts = jas_alloc2(cp->numcmpts, sizeof(jpc_enc_tcmpt_t)))) { + goto error; + } + /* Initialize a few members critical for error recovery. */ +@@ -2144,7 +2144,7 @@ + jas_seq2d_ystart(tcmpt->data), jas_seq2d_xend(tcmpt->data), + jas_seq2d_yend(tcmpt->data), bandinfos); + +- if (!(tcmpt->rlvls = jas_malloc(tcmpt->numrlvls * sizeof(jpc_enc_rlvl_t)))) { ++ if (!(tcmpt->rlvls = jas_alloc2(tcmpt->numrlvls, sizeof(jpc_enc_rlvl_t)))) { + goto error; + } + for (rlvlno = 0, rlvl = tcmpt->rlvls; rlvlno < tcmpt->numrlvls; +@@ -2247,7 +2247,7 @@ + rlvl->numvprcs = JPC_FLOORDIVPOW2(brprcbry - tlprctly, rlvl->prcheightexpn); + rlvl->numprcs = rlvl->numhprcs * rlvl->numvprcs; + +- if (!(rlvl->bands = jas_malloc(rlvl->numbands * sizeof(jpc_enc_band_t)))) { ++ if (!(rlvl->bands = jas_alloc2(rlvl->numbands, sizeof(jpc_enc_band_t)))) { + goto error; + } + for (bandno = 0, band = rlvl->bands; bandno < rlvl->numbands; +@@ -2324,7 +2324,7 @@ + band->synweight = bandinfo->synenergywt; + + if (band->data) { +- if (!(band->prcs = jas_malloc(rlvl->numprcs * sizeof(jpc_enc_prc_t)))) { ++ if (!(band->prcs = jas_alloc2(rlvl->numprcs, sizeof(jpc_enc_prc_t)))) { + goto error; + } + for (prcno = 0, prc = band->prcs; prcno < rlvl->numprcs; ++prcno, +@@ -2456,7 +2456,7 @@ + goto error; + } + +- if (!(prc->cblks = jas_malloc(prc->numcblks * sizeof(jpc_enc_cblk_t)))) { ++ if (!(prc->cblks = jas_alloc2(prc->numcblks, sizeof(jpc_enc_cblk_t)))) { + goto error; + } + for (cblkno = 0, cblk = prc->cblks; cblkno < (uint_fast32_t)prc->numcblks; +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_mqdec.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_mqdec.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_mqdec.c 2009-02-16 15:00:17.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_mqdec.c 2011-12-20 15:43:50.878307929 -0500 +@@ -118,7 +118,7 @@ + mqdec->in = in; + mqdec->maxctxs = maxctxs; + /* Allocate memory for the per-context state information. */ +- if (!(mqdec->ctxs = jas_malloc(mqdec->maxctxs * sizeof(jpc_mqstate_t *)))) { ++ if (!(mqdec->ctxs = jas_alloc2(mqdec->maxctxs, sizeof(jpc_mqstate_t *)))) { + goto error; + } + /* Set the current context to the first context. */ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_mqenc.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_mqenc.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_mqenc.c 2009-02-16 15:00:17.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_mqenc.c 2011-12-20 15:43:50.878307929 -0500 +@@ -197,7 +197,7 @@ + mqenc->maxctxs = maxctxs; + + /* Allocate memory for the per-context state information. */ +- if (!(mqenc->ctxs = jas_malloc(mqenc->maxctxs * sizeof(jpc_mqstate_t *)))) { ++ if (!(mqenc->ctxs = jas_alloc2(mqenc->maxctxs, sizeof(jpc_mqstate_t *)))) { + goto error; + } + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_qmfb.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_qmfb.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_qmfb.c 2009-02-16 15:00:17.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_qmfb.c 2011-12-20 15:43:50.878307929 -0500 +@@ -183,7 +183,7 @@ + #if !defined(HAVE_VLA) + /* Get a buffer. */ + if (bufsize > QMFB_SPLITBUFSIZE) { +- if (!(buf = jas_malloc(bufsize * sizeof(jpc_fix_t)))) { ++ if (!(buf = jas_alloc2(bufsize, sizeof(jpc_fix_t)))) { + /* We have no choice but to commit suicide in this case. */ + jas_error( JAS_ERR_MALLOC_FAILURE_JPC_QMFB1D_SPLIT, + "JAS_ERR_MALLOC_FAILURE_JPC_QMFB1D_SPLIT" +@@ -306,7 +306,7 @@ + #if !defined(HAVE_VLA) + /* Allocate memory for the join buffer from the heap. */ + if (bufsize > QMFB_JOINBUFSIZE) { +- if (!(buf = jas_malloc(bufsize * sizeof(jpc_fix_t)))) { ++ if (!(buf = jas_alloc2(bufsize, sizeof(jpc_fix_t)))) { + /* We have no choice but to commit suicide. */ + jas_error( JAS_ERR_MALLOC_FAILURE_JPC_QMFB1D_JOIN, + "JAS_ERR_MALLOC_FAILURE_JPC_QMFB1D_JOIN" +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_t1enc.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_t1enc.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_t1enc.c 2009-02-16 15:00:17.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_t1enc.c 2011-12-20 15:43:50.882307929 -0500 +@@ -220,7 +220,7 @@ + + cblk->numpasses = (cblk->numbps > 0) ? (3 * cblk->numbps - 2) : 0; + if (cblk->numpasses > 0) { +- cblk->passes = jas_malloc(cblk->numpasses * sizeof(jpc_enc_pass_t)); ++ cblk->passes = jas_alloc2(cblk->numpasses, sizeof(jpc_enc_pass_t)); + assert(cblk->passes); + } else { + cblk->passes = 0; +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_t2cod.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_t2cod.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_t2cod.c 2009-02-16 15:00:17.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_t2cod.c 2011-12-20 15:43:50.882307929 -0500 +@@ -573,7 +573,7 @@ + } + if (pchglist->numpchgs >= pchglist->maxpchgs) { + newmaxpchgs = pchglist->maxpchgs + 128; +- if (!(newpchgs = jas_realloc(pchglist->pchgs, newmaxpchgs * sizeof(jpc_pchg_t *)))) { ++ if (!(newpchgs = jas_realloc2(pchglist->pchgs, newmaxpchgs, sizeof(jpc_pchg_t *)))) { + return -1; + } + pchglist->maxpchgs = newmaxpchgs; +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_t2dec.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_t2dec.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_t2dec.c 2009-02-16 15:00:17.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_t2dec.c 2011-12-20 15:43:50.882307929 -0500 +@@ -478,7 +478,7 @@ + return 0; + } + pi->numcomps = dec->numcomps; +- if (!(pi->picomps = jas_malloc(pi->numcomps * sizeof(jpc_picomp_t)))) { ++ if (!(pi->picomps = jas_alloc2(pi->numcomps, sizeof(jpc_picomp_t)))) { + jpc_pi_destroy(pi); + return 0; + } +@@ -490,7 +490,7 @@ + for (compno = 0, tcomp = tile->tcomps, picomp = pi->picomps; + compno < pi->numcomps; ++compno, ++tcomp, ++picomp) { + picomp->numrlvls = tcomp->numrlvls; +- if (!(picomp->pirlvls = jas_malloc(picomp->numrlvls * ++ if (!(picomp->pirlvls = jas_alloc2(picomp->numrlvls, + sizeof(jpc_pirlvl_t)))) { + jpc_pi_destroy(pi); + return 0; +@@ -503,7 +503,7 @@ + rlvlno < picomp->numrlvls; ++rlvlno, ++pirlvl, ++rlvl) { + /* XXX sizeof(long) should be sizeof different type */ + pirlvl->numprcs = rlvl->numprcs; +- if (!(pirlvl->prclyrnos = jas_malloc(pirlvl->numprcs * ++ if (!(pirlvl->prclyrnos = jas_alloc2(pirlvl->numprcs, + sizeof(long)))) { + jpc_pi_destroy(pi); + return 0; +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_t2enc.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_t2enc.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_t2enc.c 2009-02-16 15:00:17.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_t2enc.c 2011-12-20 15:43:50.882307929 -0500 +@@ -565,7 +565,7 @@ + } + pi->pktno = -1; + pi->numcomps = cp->numcmpts; +- if (!(pi->picomps = jas_malloc(pi->numcomps * sizeof(jpc_picomp_t)))) { ++ if (!(pi->picomps = jas_alloc2(pi->numcomps, sizeof(jpc_picomp_t)))) { + jpc_pi_destroy(pi); + return 0; + } +@@ -577,7 +577,7 @@ + for (compno = 0, tcomp = tile->tcmpts, picomp = pi->picomps; + compno < pi->numcomps; ++compno, ++tcomp, ++picomp) { + picomp->numrlvls = tcomp->numrlvls; +- if (!(picomp->pirlvls = jas_malloc(picomp->numrlvls * ++ if (!(picomp->pirlvls = jas_alloc2(picomp->numrlvls, + sizeof(jpc_pirlvl_t)))) { + jpc_pi_destroy(pi); + return 0; +@@ -591,7 +591,7 @@ + /* XXX sizeof(long) should be sizeof different type */ + pirlvl->numprcs = rlvl->numprcs; + if (rlvl->numprcs) { +- if (!(pirlvl->prclyrnos = jas_malloc(pirlvl->numprcs * ++ if (!(pirlvl->prclyrnos = jas_alloc2(pirlvl->numprcs, + sizeof(long)))) { + jpc_pi_destroy(pi); + return 0; +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_tagtree.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_tagtree.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_tagtree.c 2009-02-16 15:00:17.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_tagtree.c 2011-12-20 15:43:50.882307929 -0500 +@@ -125,7 +125,7 @@ + ++numlvls; + } while (n > 1); + +- if (!(tree->nodes_ = jas_malloc(tree->numnodes_ * sizeof(jpc_tagtreenode_t)))) { ++ if (!(tree->nodes_ = jas_alloc2(tree->numnodes_, sizeof(jpc_tagtreenode_t)))) { + return 0; + } + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_util.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_util.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_util.c 2009-02-16 15:00:17.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_util.c 2011-12-20 15:43:50.882307929 -0500 +@@ -109,7 +109,7 @@ + } + + if (n) { +- if (!(vs = jas_malloc(n * sizeof(double)))) { ++ if (!(vs = jas_alloc2(n, sizeof(double)))) { + return -1; + } + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/mif/mif_cod.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/mif/mif_cod.c +--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/mif/mif_cod.c 2009-02-16 15:00:17.000000000 -0500 ++++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/mif/mif_cod.c 2011-12-20 15:43:50.882307929 -0500 +@@ -439,8 +439,7 @@ + int cmptno; + mif_cmpt_t **newcmpts; + assert(maxcmpts >= hdr->numcmpts); +- newcmpts = (!hdr->cmpts) ? jas_malloc(maxcmpts * sizeof(mif_cmpt_t *)) : +- jas_realloc(hdr->cmpts, maxcmpts * sizeof(mif_cmpt_t *)); ++ newcmpts = jas_realloc2(hdr->cmpts, maxcmpts, sizeof(mif_cmpt_t *)); + if (!newcmpts) { + return -1; + } --- ghostscript-8.71.dfsg.1.orig/debian/patches/00list +++ ghostscript-8.71.dfsg.1/debian/patches/00list @@ -0,0 +1,16 @@ +01_docdir-fix-for-debian +02_gs-man-fix-for-debian +fix-build-of-executables +no-cant-refill-scanner-input-buffer-error +fix-broken-korean-example +pdftoraster-wait-for-ghostscript +pdf2dsc-fix-for-pdflatex-preview +pdf-interpreter-segfault-fixes +cups-raster-fixes +fapi-buildchar-object-null-check +CVE-2010-1628 +ps2pdf-hyperlinks +CVE-2008-352x +CVE-2011-451x +CVE-2012-4405 +CVE-2014-9029 --- ghostscript-8.71.dfsg.1.orig/debian/patches/CVE-2012-4405.dpatch +++ ghostscript-8.71.dfsg.1/debian/patches/CVE-2012-4405.dpatch @@ -0,0 +1,21 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +# Description: fix denial of service and possible code execution via +# icclib overflow +# Origin: Thanks to Red Hat + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/icclib/icc.c ghostscript-8.71.dfsg.1/icclib/icc.c +--- ghostscript-8.71.dfsg.1~/icclib/icc.c 2009-07-28 03:48:19.000000000 -0400 ++++ ghostscript-8.71.dfsg.1/icclib/icc.c 2012-09-21 08:55:30.355321681 -0400 +@@ -5006,6 +5006,11 @@ + p->clutPoints = read_UInt8Number(bp+10); + + /* Sanity check */ ++ if (p->inputChan < 1) { ++ sprintf(icp->err,"icmLut_read: No input channels!"); ++ return icp->errc = 1; ++ } ++ + if (p->inputChan > MAX_CHAN) { + sprintf(icp->err,"icmLut_read: Can't handle > %d input channels\n",MAX_CHAN); + return icp->errc = 1;