tools/fax2ps.c:295: error: Integer Overflow L2
  ([0, +oo] - 1):unsigned32 by call to `printTIF`.

tools/fax2ps.c:283:1: Parameter `tif->tif_dir.td_rowsperstrip`
281. }
282. 
283. void
     ^
284. fax2ps(TIFF* tif, uint16 npages, uint16* pages, char* filename)
285. {

tools/fax2ps.c:294:10: Call
292. 		filename);
293. 	for (i = 0; i < npages; i++) {
294. 	    if (findPage(tif, pages[i]))
              ^
295. 		printTIF(tif, pages[i]);
296. 	    else

tools/fax2ps.c:270:1: Parameter `tif->tif_dir.td_rowsperstrip`
  268. TIFFGetField(tif, TIFFTAG_PAGENUMBER, &pn, &ptotal)
  269. 
  270. int
       ^
  271. findPage(TIFF* tif, uint16 pageNumber)
  272. {

tools/fax2ps.c:295:3: Call
293. 	for (i = 0; i < npages; i++) {
294. 	    if (findPage(tif, pages[i]))
295. 		printTIF(tif, pages[i]);
       ^
296. 	    else
297. 		fprintf(stderr, "%s: No page number %d\n", filename, pages[i]);

tools/fax2ps.c:193:1: Parameter `tif->tif_dir.td_rowsperstrip`
  191. }
  192. 
  193. void
       ^
  194. printTIF(TIFF* tif, uint16 pageNumber)
  195. {

tools/fax2ps.c:258:10: Call
  256.     printf("0 setgray\n");
  257.     TIFFSetField(tif, TIFFTAG_FAXFILLFUNC, printruns);
  258.     ns = TIFFNumberOfStrips(tif);
                ^
  259.     row = 0;
  260.     for (s = 0; s < ns; s++)

libtiff/tif_strip.c:86:1: <LHS trace>
84.  * Compute how many strips are in an image.
85.  */
86. uint32
    ^
87. TIFFNumberOfStrips(TIFF* tif)
88. {

libtiff/tif_strip.c:86:1: Parameter `tif->tif_dir.td_rowsperstrip`
    84.  * Compute how many strips are in an image.
    85.  */
    86. uint32
        ^
    87. TIFFNumberOfStrips(TIFF* tif)
    88. {

libtiff/tif_strip.c:92:13: Binary operation: ([0, +oo] - 1):unsigned32 by call to `printTIF` 
    90. 	uint32 nstrips;
    91. 
    92. 	nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
                    ^
    93. 	     TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
    94. 	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)

uint32
TIFFNumberOfStrips(TIFF* tif)
{
	TIFFDirectory *td = &tif->tif_dir;
	uint32 nstrips;
	nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
	     TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
		nstrips = multiply_32(tif, nstrips, (uint32)td->td_samplesperpixel,
		    "TIFFNumberOfStrips");
	return (nstrips);
}
['void\nfax2ps(TIFF* tif, uint16 npages, uint16* pages, char* filename)\n{\n    if (npages > 0) {\n\tuint16 pn, ptotal;\n\tint i;\n\tif (!GetPageNumber(tif))\n\t    fprintf(stderr, "%s: No page numbers, counting directories.\\n",\n\t\tfilename);\n\tfor (i = 0; i < npages; i++) {\n\t    if (findPage(tif, pages[i]))\n\t\tprintTIF(tif, pages[i]);\n\t    else\n\t\tfprintf(stderr, "%s: No page number %d\\n", filename, pages[i]);\n\t}\n    } else {\n\tuint16 pageNumber = 0;\n\tdo\n\t    printTIF(tif, pageNumber++);\n\twhile (TIFFReadDirectory(tif));\n    }\n}', 'int\nfindPage(TIFF* tif, uint16 pageNumber)\n{\n    uint16 pn = (uint16) -1;\n    uint16 ptotal = (uint16) -1;\n    if (GetPageNumber(tif)) {\n\twhile (pn != pageNumber && TIFFReadDirectory(tif) && GetPageNumber(tif))\n\t    ;\n\treturn (pn == pageNumber);\n    } else\n\treturn (TIFFSetDirectory(tif, (tdir_t)(pageNumber-1)));\n}', 'void\nprintTIF(TIFF* tif, uint16 pageNumber)\n{\n    uint32 w, h;\n    uint16 unit, compression;\n    float xres, yres, scale = 1.0;\n    tstrip_t s, ns;\n    time_t creation_time;\n    TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h);\n    TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &w);\n    if (!TIFFGetField(tif, TIFFTAG_COMPRESSION, &compression)\n\t|| compression < COMPRESSION_CCITTRLE\n\t|| compression > COMPRESSION_CCITT_T6)\n\treturn;\n    if (!TIFFGetField(tif, TIFFTAG_XRESOLUTION, &xres) || !xres) {\n\tTIFFWarning(TIFFFileName(tif),\n\t    "No x-resolution, assuming %g dpi", defxres);\n\txres = defxres;\n    }\n    if (!TIFFGetField(tif, TIFFTAG_YRESOLUTION, &yres) || !yres) {\n\tTIFFWarning(TIFFFileName(tif),\n\t    "No y-resolution, assuming %g lpi", defyres);\n\tyres = defyres;\n    }\n    if (TIFFGetField(tif, TIFFTAG_RESOLUTIONUNIT, &unit) &&\n      unit == RESUNIT_CENTIMETER) {\n\txres *= 2.54F;\n\tyres *= 2.54F;\n    }\n    if (pageWidth == 0)\n\tpageWidth = w / xres;\n    if (pageHeight == 0)\n\tpageHeight = h / yres;\n    printf("%%!PS-Adobe-3.0\\n");\n    printf("%%%%Creator: fax2ps\\n");\n#ifdef notdef\n    printf("%%%%Title: %s\\n", file);\n#endif\n    creation_time = time(0);\n    printf("%%%%CreationDate: %s", ctime(&creation_time));\n    printf("%%%%Origin: 0 0\\n");\n    printf("%%%%BoundingBox: 0 0 %u %u\\n",\n\t(int)(pageWidth * points), (int)(pageHeight * points));\n    printf("%%%%Pages: (atend)\\n");\n    printf("%%%%EndComments\\n");\n    printf("%%%%BeginProlog\\n");\n    emitFont(stdout);\n    printf("/d{bind def}def\\n");\n    printf("/m{0 exch moveto}d\\n");\n    printf("/s{show}d\\n");\n    printf("/p{showpage}d \\n");\n    printf("%%%%EndProlog\\n");\n    printf("%%%%Page: \\"%u\\" %u\\n", pageNumber, pageNumber);\n    printf("/$pageTop save def gsave\\n");\n    if (scaleToPage)\n        scale = pageHeight / (h/yres) < pageWidth / (w/xres) ?\n            pageHeight / (h/yres) : pageWidth / (w/xres);\n    printf("%g %g translate\\n",\n           points * (pageWidth - scale*w/xres) * half,\n           points * (scale*h/yres + (pageHeight - scale*h/yres) * half));\n    printf("%g %g scale\\n", points/xres*scale, -points/yres*scale);\n    printf("0 setgray\\n");\n    TIFFSetField(tif, TIFFTAG_FAXFILLFUNC, printruns);\n    ns = TIFFNumberOfStrips(tif);\n    row = 0;\n    for (s = 0; s < ns; s++)\n\t(void) TIFFReadEncodedStrip(tif, s, (tdata_t) NULL, (tsize_t) -1);\n    printf("p\\n");\n    printf("grestore $pageTop restore\\n");\n    totalPages++;\n}', 'uint32\nTIFFNumberOfStrips(TIFF* tif)\n{\n\tTIFFDirectory *td = &tif->tif_dir;\n\tuint32 nstrips;\n\tnstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :\n\t     TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));\n\tif (td->td_planarconfig == PLANARCONFIG_SEPARATE)\n\t\tnstrips = multiply_32(tif, nstrips, (uint32)td->td_samplesperpixel,\n\t\t    "TIFFNumberOfStrips");\n\treturn (nstrips);\n}']