tools/tiffcrop.c:7040: error: Integer Overflow L2
  ([min(1, `out->tif_dir.td_imagedepth`), 4294967294] + [0, 4294967294-min(1, `out->tif_dir.td_imagedepth`)]):unsigned32 by call to `writeSingleSection`.

tools/tiffcrop.c:6998:1: Parameter `out->tif_dir.td_imagedepth`
6996.   } /* end writeRegions */
6997. 
6998. static int
      ^
6999. writeImageSections(TIFF *in, TIFF *out, struct image_data *image,
7000. 		   struct pagedef *page, struct pageseg *sections,

tools/tiffcrop.c:7040:9: Call
7038. 
7039.   /* call the write routine here instead of outside the loop */
7040.     if (writeSingleSection(in, out, image, dump, width, length, hres, vres, sect_buff))
              ^
7041.       {
7042.       TIFFError("writeImageSections", "Unable to write image section");

tools/tiffcrop.c:7056:1: Parameter `out->tif_dir.td_imagedepth`
  7054.  * original code assumes we are always copying all samples.
  7055.  */
  7056. static int  
        ^
  7057. writeSingleSection(TIFF *in, TIFF *out, struct image_data *image,
  7058.                    struct dump_opts *dump, uint32 width, uint32 length,

tools/tiffcrop.c:7304:7: Call
  7302.     {
  7303.     if (config == PLANARCONFIG_CONTIG)
  7304.       writeBufferToContigTiles (out, sect_buff, length, width, spp, dump);
              ^
  7305.     else
  7306.       writeBufferToSeparateTiles (out, sect_buff, length, width, spp, dump);

tools/tiffcrop.c:1227:1: Parameter `out->tif_dir.td_imagedepth`
    1225.  * to be written out as a tile.
    1226.  */
    1227. static int writeBufferToContigTiles (TIFF* out, uint8* buf, uint32 imagelength,
          ^
    1228. 				       uint32 imagewidth, tsample_t spp, 
    1229.                                        struct dump_opts* dump)

tools/tiffcrop.c:1304:11: Call
    1302.         }
    1303. 
    1304.       if (TIFFWriteTile(out, tilebuf, col, row, 0, 0) < 0)
                    ^
    1305.         {
    1306. 	TIFFError("writeBufferToContigTiles",

libtiff/tif_write.c:363:1: Parameter `tif->tif_dir.td_imagedepth`
      361.  * tile is selected by the (x,y,z,s) coordinates.
      362.  */
      363. tmsize_t
           ^
      364. TIFFWriteTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s)
      365. {

libtiff/tif_write.c:366:7: Call
      364. TIFFWriteTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s)
      365. {
      366. 	if (!TIFFCheckTile(tif, x, y, z, s))
                 ^
      367. 		return ((tmsize_t)(-1));
      368. 	/*

libtiff/tif_tile.c:72:1: Parameter `z`
        70.  * against the image bounds.
        71.  */
        72. int
            ^
        73. TIFFCheckTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s)
        74. {

libtiff/tif_write.c:375:6: Call
      373. 	 */
      374. 	return (TIFFWriteEncodedTile(tif,
      375. 	    TIFFComputeTile(tif, x, y, z, s), buf, (tmsize_t)(-1)));
                ^
      376. }
      377. 

libtiff/tif_tile.c:35:1: Parameter `tif->tif_dir.td_imagedepth`
        33.  * Compute which tile an (x,y,z,s) value is in.
        34.  */
        35. uint32
            ^
        36. TIFFComputeTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s)
        37. {

libtiff/tif_write.c:374:10: Call
      372. 	 *     after the output buffer is setup in TIFFWriteBufferSetup.
      373. 	 */
      374. 	return (TIFFWriteEncodedTile(tif,
                    ^
      375. 	    TIFFComputeTile(tif, x, y, z, s), buf, (tmsize_t)(-1)));
      376. }

libtiff/tif_write.c:390:1: Parameter `tif->tif_dir.td_imagedepth`
        388.  *     the image on each write (as TIFFWriteScanline does).
        389.  */
        390. tmsize_t
             ^
        391. TIFFWriteEncodedTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc)
        392. {

libtiff/tif_write.c:398:7: Call
        396.         uint32 howmany32;
        397. 
        398. 	if (!WRITECHECKTILES(tif, module))
                   ^
        399. 		return ((tmsize_t)(-1));
        400. 	td = &tif->tif_dir;

libtiff/tif_write.c:564:1: Parameter `tif->tif_dir.td_imagedepth`
          562.  * that important information is not changed.
          563.  */
          564. int
               ^
          565. TIFFWriteCheck(TIFF* tif, int tiles, const char* module)
          566. {

libtiff/tif_write.c:640:13: Call
          638.             !(tif->tif_flags & TIFF_DIRTYDIRECT)  )
          639.         {
          640.             TIFFForceStrileArrayWriting(tif);
                           ^
          641.         }
          642. 

libtiff/tif_flush.c:78:1: Parameter `tif->tif_dir.td_imagedepth`
            76.  * Returns 1 in case of success, 0 otherwise.
            77.  */
            78. int TIFFForceStrileArrayWriting(TIFF* tif)
                ^
            79. {
            80.     static const char module[] = "TIFFForceStrileArrayWriting";

libtiff/tif_flush.c:120:55: Call
            118.         }
            119. 
            120.         if (tif->tif_dir.td_stripoffset_p == NULL && !TIFFSetupStrips(tif))
                                                                       ^
            121.             return 0;
            122.     }

libtiff/tif_write.c:522:1: Parameter `tif->tif_dir.td_imagedepth`
              520.     (TIFFFieldSet(tif,f) && (tif)->tif_dir.td_imagelength == 0)
              521. 
              522. int
                   ^
              523. TIFFSetupStrips(TIFF* tif)
              524. {

libtiff/tif_write.c:530:29: Call
              528. 		td->td_stripsperimage =
              529. 		    isUnspecified(tif, FIELD_TILEDIMENSIONS) ?
              530. 			td->td_samplesperpixel : TIFFNumberOfTiles(tif);
                                               ^
              531. 	else
              532. 		td->td_stripsperimage =

libtiff/tif_tile.c:112:1: <LHS trace>
110.  * Compute how many tiles are in an image.
111.  */
112. uint32
     ^
113. TIFFNumberOfTiles(TIFF* tif)
114. {

libtiff/tif_tile.c:112:1: Parameter `tif->tif_dir.td_imagedepth`
                110.  * Compute how many tiles are in an image.
                111.  */
                112. uint32
                     ^
                113. TIFFNumberOfTiles(TIFF* tif)
                114. {

libtiff/tif_tile.c:112:1: <RHS trace>
110.  * Compute how many tiles are in an image.
111.  */
112. uint32
     ^
113. TIFFNumberOfTiles(TIFF* tif)
114. {

libtiff/tif_tile.c:112:1: Parameter `tif->tif_dir.td_imagedepth`
                110.  * Compute how many tiles are in an image.
                111.  */
                112. uint32
                     ^
                113. TIFFNumberOfTiles(TIFF* tif)
                114. {

libtiff/tif_tile.c:131:6: Binary operation: ([min(1, out->tif_dir.td_imagedepth), 4294967294] + [0, 4294967294-min(1, out->tif_dir.td_imagedepth)]):unsigned32 by call to `writeSingleSection` 
                129. 	    TIFFhowmany_32(td->td_imagelength, dy),
                130. 	    "TIFFNumberOfTiles"),
                131. 	    TIFFhowmany_32(td->td_imagedepth, dz), "TIFFNumberOfTiles");
                          ^
                132. 	if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
                133. 		ntiles = _TIFFMultiply32(tif, ntiles, td->td_samplesperpixel,
