tools/tiffcp.c:1001: error: Integer Overflow L2
  ([0, `imagewidth`] - 1):unsigned32.

tools/tiffcp.c:980:1: <LHS trace>
978.  * Contig -> separate by row.
979.  */
980. DECLAREcpFunc(cpContig2SeparateByRow)
     ^
981. {
982. 	tdata_t inbuf = _TIFFmalloc(TIFFScanlineSize(in));

tools/tiffcp.c:980:1: Parameter `imagewidth`
978.  * Contig -> separate by row.
979.  */
980. DECLAREcpFunc(cpContig2SeparateByRow)
     ^
981. {
982. 	tdata_t inbuf = _TIFFmalloc(TIFFScanlineSize(in));

tools/tiffcp.c:1001:9: Assignment
 999. 			inp = ((uint8*)inbuf) + s;
1000. 			outp = (uint8*)outbuf;
1001. 			for (n = imagewidth; n-- > 0;) {
              ^
1002. 				*outp++ = *inp;
1003. 				inp += spp;

tools/tiffcp.c:1001:25: Binary operation: ([0, imagewidth] - 1):unsigned32
 999. 			inp = ((uint8*)inbuf) + s;
1000. 			outp = (uint8*)outbuf;
1001. 			for (n = imagewidth; n-- > 0;) {
                              ^
1002. 				*outp++ = *inp;
1003. 				inp += spp;

DECLAREcpFunc(cpContig2SeparateByRow)
{
	tdata_t inbuf = _TIFFmalloc(TIFFScanlineSize(in));
	tdata_t outbuf = _TIFFmalloc(TIFFScanlineSize(out));
	register uint8 *inp, *outp;
	register uint32 n;
	uint32 row;
	tsample_t s;
	for (s = 0; s < spp; s++) {
		for (row = 0; row < imagelength; row++) {
			if (TIFFReadScanline(in, inbuf, row, 0) < 0
			    && !ignore) {
				TIFFError(TIFFFileName(in),
				    "Error, can't read scanline %lu",
				    (unsigned long) row);
				goto bad;
			}
			inp = ((uint8*)inbuf) + s;
			outp = (uint8*)outbuf;
			for (n = imagewidth; n-- > 0;) {
				*outp++ = *inp;
				inp += spp;
			}
			if (TIFFWriteScanline(out, outbuf, row, s) < 0) {
				TIFFError(TIFFFileName(out),
				    "Error, can't write scanline %lu",
				    (unsigned long) row);
				goto bad;
			}
		}
	}
	if (inbuf) _TIFFfree(inbuf);
	if (outbuf) _TIFFfree(outbuf);
	return 1;
bad:
	if (inbuf) _TIFFfree(inbuf);
	if (outbuf) _TIFFfree(outbuf);
	return 0;
}
['DECLAREcpFunc(cpContig2SeparateByRow)\n{\n\ttdata_t inbuf = _TIFFmalloc(TIFFScanlineSize(in));\n\ttdata_t outbuf = _TIFFmalloc(TIFFScanlineSize(out));\n\tregister uint8 *inp, *outp;\n\tregister uint32 n;\n\tuint32 row;\n\ttsample_t s;\n\tfor (s = 0; s < spp; s++) {\n\t\tfor (row = 0; row < imagelength; row++) {\n\t\t\tif (TIFFReadScanline(in, inbuf, row, 0) < 0\n\t\t\t    && !ignore) {\n\t\t\t\tTIFFError(TIFFFileName(in),\n\t\t\t\t    "Error, can\'t read scanline %lu",\n\t\t\t\t    (unsigned long) row);\n\t\t\t\tgoto bad;\n\t\t\t}\n\t\t\tinp = ((uint8*)inbuf) + s;\n\t\t\toutp = (uint8*)outbuf;\n\t\t\tfor (n = imagewidth; n-- > 0;) {\n\t\t\t\t*outp++ = *inp;\n\t\t\t\tinp += spp;\n\t\t\t}\n\t\t\tif (TIFFWriteScanline(out, outbuf, row, s) < 0) {\n\t\t\t\tTIFFError(TIFFFileName(out),\n\t\t\t\t    "Error, can\'t write scanline %lu",\n\t\t\t\t    (unsigned long) row);\n\t\t\t\tgoto bad;\n\t\t\t}\n\t\t}\n\t}\n\tif (inbuf) _TIFFfree(inbuf);\n\tif (outbuf) _TIFFfree(outbuf);\n\treturn 1;\nbad:\n\tif (inbuf) _TIFFfree(inbuf);\n\tif (outbuf) _TIFFfree(outbuf);\n\treturn 0;\n}']