- Fix bitcmyk driver (bug #486644).

This commit is contained in:
Tim Waugh 2009-02-17 17:27:22 +00:00
parent 47b08ccdb4
commit 41ce9923c6
2 changed files with 43 additions and 1 deletions

35
ghostscript-bitcmyk.patch Normal file
View File

@ -0,0 +1,35 @@
diff -up ghostscript-8.64/base/gdevbit.c.bitcmyk ghostscript-8.64/base/gdevbit.c
--- ghostscript-8.64/base/gdevbit.c.bitcmyk 2008-08-21 00:58:43.000000000 +0100
+++ ghostscript-8.64/base/gdevbit.c 2009-02-17 16:27:38.000000000 +0000
@@ -653,7 +653,7 @@ bit_put_params(gx_device * pdev, gs_para
pdev->color_info.depth == 32 ? cmyk_8bit_map_cmyk_color :
bit_map_cmyk_color);
}
- /* Reset the sparable and linear shift, masks, bits. */
+ /* Reset the separable and linear shift, masks, bits. */
set_linear_color_bits_mask_shift(pdev);
pdev->color_info.separable_and_linear = GX_CINFO_SEP_LIN;
((gx_device_bit *)pdev)->FirstLine = FirstLine;
@@ -671,16 +671,18 @@ bit_print_page(gx_device_printer * pdev,
byte *in = gs_alloc_bytes(pdev->memory, line_size, "bit_print_page(in)");
byte *data;
int nul = !strcmp(pdev->fname, "nul") || !strcmp(pdev->fname, "/dev/null");
- int lnum = ((gx_device_bit *)pdev)->FirstLine;
- int bottom = ((gx_device_bit *)pdev)->LastLine;
+ int lnum = ((gx_device_bit *)pdev)->FirstLine >= pdev->height ? pdev->height - 1 :
+ ((gx_device_bit *)pdev)->FirstLine;
+ int bottom = ((gx_device_bit *)pdev)->LastLine >= pdev->height ? pdev->height - 1 :
+ ((gx_device_bit *)pdev)->LastLine;
int line_count = any_abs(bottom - lnum);
int i, step = lnum > bottom ? -1 : 1;
if (in == 0)
return_error(gs_error_VMerror);
if ((lnum == 0) && (bottom == 0))
- bottom = pdev->height - 1;
- for (i = 0; i < line_count; i++, lnum += step) {
+ line_count = pdev->height - 1; /* default when LastLine == 0, FirstLine == 0 */
+ for (i = 0; i <= line_count; i++, lnum += step) {
gdev_prn_get_bits(pdev, lnum, in, &data);
if (!nul)
fwrite(data, 1, line_size, prn_stream);

View File

@ -5,7 +5,7 @@ Summary: A PostScript interpreter and renderer.
Name: ghostscript
Version: %{gs_ver}
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv2
URL: http://www.ghostscript.com/
@ -21,6 +21,7 @@ Patch4: ghostscript-fPIC.patch
Patch5: ghostscript-runlibfileifexists.patch
Patch6: ghostscript-system-jasper.patch
Patch7: ghostscript-pksmraw.patch
Patch8: ghostscript-bitcmyk.patch
Requires: urw-fonts >= 1.1, ghostscript-fonts
BuildRequires: libjpeg-devel, libXt-devel
@ -104,6 +105,9 @@ rm -rf libpng zlib jpeg jasper
# Fix pksmraw output (bug #308211). Still needed in 8.63.
%patch7 -p1 -b .pksmraw
# Fix bitcmyk driver (bug #486644).
%patch8 -p1 -b .bitcmyk
# Convert manual pages to UTF-8
from8859_1() {
iconv -f iso-8859-1 -t utf-8 < "$1" > "${1}_"
@ -285,6 +289,9 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/libgs.so
%changelog
* Tue Feb 17 2009 Tim Waugh <twaugh@redhat.com> 8.64-3
- Fix bitcmyk driver (bug #486644).
* Wed Feb 4 2009 Tim Waugh <twaugh@redhat.com> 8.64-2
- 8.64 (bug #483958).
- Removed trade marks to avoid any potential confusion.