* tools/fax2ps.c: be consistent with page-numbering

http://bugzilla.maptools.org/show_bug.cgi?id=2225
This commit is contained in:
Lee Howard 2010-12-14 03:16:45 +00:00
parent 70c91edf7c
commit 630dc52808
2 changed files with 8 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2010-12-13 Lee Howard <faxguy@howardsilvan.com>
* tools/fax2ps.c: be consistent with page-numbering
http://bugzilla.maptools.org/show_bug.cgi?id=2225
2010-12-13 Lee Howard <faxguy@howardsilvan.com>
* libtiff/tif_color.c: prevent crash in handling bad TIFFs

View File

@ -1,4 +1,4 @@
/* $Id: fax2ps.c,v 1.25 2010-12-12 01:11:56 faxguy Exp $" */
/* $Id: fax2ps.c,v 1.26 2010-12-14 03:16:45 faxguy Exp $" */
/*
* Copyright (c) 1991-1997 Sam Leffler
@ -277,9 +277,9 @@ findPage(TIFF* tif, uint16 pageNumber)
uint16 pn = (uint16) -1;
uint16 ptotal = (uint16) -1;
if (GetPageNumber(tif)) {
while (pn != pageNumber && TIFFReadDirectory(tif) && GetPageNumber(tif))
while (pn != (pageNumber-1) && TIFFReadDirectory(tif) && GetPageNumber(tif))
;
return (pn == pageNumber);
return (pn == (pageNumber-1));
} else
return (TIFFSetDirectory(tif, (tdir_t)(pageNumber-1)));
}