tools/tiffcrop.c:7318: 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 `TIFFClose`.

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:7316:8: Call
7314.     }
7315. 
7316.   if (!TIFFWriteDirectory(out))
             ^
7317.     {
7318.     TIFFClose(out);

libtiff/tif_dirwrite.c:178:1: Parameter `tif->tif_dir.td_imagedepth`
  176.  * storage that's been changed.
  177.  */
  178. int
       ^
  179. TIFFWriteDirectory(TIFF* tif)
  180. {

libtiff/tif_dirwrite.c:181:9: Call
  179. TIFFWriteDirectory(TIFF* tif)
  180. {
  181. 	return TIFFWriteDirectorySec(tif,TRUE,TRUE,NULL);
               ^
  182. }
  183. 

libtiff/tif_dirwrite.c:405:1: Parameter `tif->tif_dir.td_imagedepth`
    403. }
    404. 
    405. static int
         ^
    406. TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
    407. {

tools/tiffcrop.c:7318:5: Call
7316.   if (!TIFFWriteDirectory(out))
7317.     {
7318.     TIFFClose(out);
          ^
7319.     return (-1);
7320.     }

libtiff/tif_close.c:120:1: Parameter `tif->tif_dir.td_imagedepth`
  118.  */
  119. 
  120. void
       ^
  121. TIFFClose(TIFF* tif)
  122. {

libtiff/tif_close.c:126:2: Call
  124. 	thandle_t fd = tif->tif_clientdata;
  125. 
  126. 	TIFFCleanup(tif);
        ^
  127. 	(void) (*closeproc)(fd);
  128. }

libtiff/tif_close.c:44:1: Parameter `tif->tif_dir.td_imagedepth`
    42.  */
    43. 
    44. void
        ^
    45. TIFFCleanup(TIFF* tif)
    46. {

libtiff/tif_close.c:51:3: Call
    49.          */
    50. 	if (tif->tif_mode != O_RDONLY)
    51. 		TIFFFlush(tif);
          ^
    52. 	(*tif->tif_cleanup)(tif);
    53. 	TIFFFreeDirectory(tif);

libtiff/tif_flush.c:30:1: Parameter `tif->tif_dir.td_imagedepth`
      28. #include "tiffiop.h"
      29. 
      30. int
          ^
      31. TIFFFlush(TIFF* tif)
      32. {

libtiff/tif_flush.c:48:13: Call
      46.         && tif->tif_mode == O_RDWR )
      47.     {
      48.         if( TIFFForceStrileArrayWriting(tif) )
                      ^
      49.             return 1;
      50.     }

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 `TIFFClose` 
            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,
