diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2018-03-27 14:08:47 +0100 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2018-03-29 13:44:03 +0100 |
commit | 003c4211a019eb5c4719860f353777e177553490 (patch) | |
tree | e526be8e98c305b1cc135714fa7c9e272ecfd20a /tiff/tools/tiff2ps.c | |
parent | bc817a3afdb932eadac17155834f89efd1c96da4 (diff) | |
download | ghostpdl-003c4211a019eb5c4719860f353777e177553490.tar.gz |
Update libtiff to 4.0.9
Add in portability changes to tiffiop.h
Portability tiffiop.h
Remove globals from tif_pixarlog.c
Tweaks to support libtiff 4.0.9
Diffstat (limited to 'tiff/tools/tiff2ps.c')
-rw-r--r-- | tiff/tools/tiff2ps.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tiff/tools/tiff2ps.c b/tiff/tools/tiff2ps.c index 82a5d84b4..f1f0b3726 100644 --- a/tiff/tools/tiff2ps.c +++ b/tiff/tools/tiff2ps.c @@ -1,4 +1,4 @@ -/* $Id: tiff2ps.c,v 1.54 2015-06-21 01:09:10 bfriesen Exp $ */ +/* $Id: tiff2ps.c,v 1.56 2017-04-27 15:46:22 erouault Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -466,10 +466,16 @@ main(int argc, char* argv[]) if (tif != NULL) { if (dirnum != -1 && !TIFFSetDirectory(tif, (tdir_t)dirnum)) + { + TIFFClose(tif); return (-1); + } else if (diroff != 0 && !TIFFSetSubDirectory(tif, diroff)) + { + TIFFClose(tif); return (-1); + } np = TIFF2PS(output, tif, pageWidth, pageHeight, leftmargin, bottommargin, centered); if (np < 0) @@ -2440,6 +2446,11 @@ PSDataColorContig(FILE* fd, TIFF* tif, uint32 w, uint32 h, int nc) unsigned char *cp, c; (void) w; + if( es <= 0 ) + { + TIFFError(filename, "Inconsistent value of es: %d", es); + return; + } tf_buf = (unsigned char *) _TIFFmalloc(tf_bytesperrow); if (tf_buf == NULL) { TIFFError(filename, "No space for scanline buffer"); @@ -2692,7 +2703,7 @@ PSDataBW(FILE* fd, TIFF* tif, uint32 w, uint32 h) if (alpha) { int adjust; - while (cc-- > 0) { + while (cc-- > 1) { DOBREAK(breaklen, 1, fd); /* * For images with alpha, matte against |