tools/tiffcrop.c:6977: error: Buffer Overrun L3
  Offset: [3, +oo] (⇐ [0, +oo] + 3) Size: [0, +oo] by call to `update_output_file`.

tools/tiffcrop.c:6891:1: Parameter `(*out)->tif_dir.td_nstrips`
6889.   } /* end extractImageSection */
6890. 
6891. static int 
      ^
6892. writeSelections(TIFF *in, TIFF **out, struct crop_mask *crop, 
6893.                 struct image_data *image, struct dump_opts *dump,

tools/tiffcrop.c:6977:16: Call
6975.          for (i = 0; i < crop->selections; i++)
6976.            {
6977.            if (update_output_file (out, mp, autoindex, filename, page))
                     ^
6978.              return (1);
6979. 

tools/tiffcrop.c:2106:1: Parameter `(*tiffout)->tif_dir.td_nstrips`
  2104.  * so TIFFTAG PAGENUM will be correct in image.
  2105.  */
  2106. static int
        ^
  2107. update_output_file (TIFF **tiffout, char *mode, int autoindex,
  2108.                     char *outname, unsigned int *page)

tools/tiffcrop.c:2119:5: Call
  2117.     {
  2118.     /* Close any export file that was previously opened */
  2119.     TIFFClose (*tiffout);
            ^
  2120.     *tiffout = NULL;
  2121.     }

libtiff/tif_close.c:120:1: Parameter `tif->tif_dir.td_nstrips`
    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_nstrips`
      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_nstrips`
        28. #include "tiffiop.h"
        29. 
        30. int
            ^
        31. TIFFFlush(TIFF* tif)
        32. {

libtiff/tif_flush.c:36:10: Call
        34.         return 1;
        35. 
        36.     if (!TIFFFlushData(tif))
                     ^
        37.         return (0);
        38.                 

libtiff/tif_flush.c:96:1: Parameter `tif->tif_dir.td_nstrips`
          94.  * problems for other people. 
          95.  */
          96. int
              ^
          97. TIFFFlushData(TIFF* tif)
          98. {

libtiff/tif_flush.c:81:13: Call
        79. 
        80.     if ((tif->tif_flags & (TIFF_DIRTYDIRECT|TIFF_DIRTYSTRIP)) 
        81.         && !TIFFRewriteDirectory(tif))
                        ^
        82.         return (0);
        83. 

libtiff/tif_dirwrite.c:215:1: Parameter `tif->tif_dir.td_nstrips`
          213.  * previously used directory space. 
          214.  */ 
          215. int
               ^
          216. TIFFRewriteDirectory( TIFF *tif )
          217. {

libtiff/tif_dirwrite.c:222:10: Call
          220. 	/* We don't need to do anything special if it hasn't been written. */
          221. 	if( tif->tif_diroff == 0 )
          222. 		return TIFFWriteDirectory( tif );
                        ^
          223. 
          224. 	/*

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

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

libtiff/tif_dirwrite.c:361:1: Parameter `tif->tif_dir.td_nstrips`
              359. }
              360. 
              361. static int
                   ^
              362. TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
              363. {

libtiff/tif_dirwrite.c:556:26: Call
              554.                     */
              555.                     if (tif->tif_dir.td_stripoffset != NULL &&
              556.                         !TIFFWriteDirectoryTagLongLong8Array(tif,&ndir,dir,TIFFTAG_STRIPOFFSETS,tif->tif_dir.td_nstrips,tif->tif_dir.td_stripoffset))
                                            ^
              557.                         goto bad;
              558. 				}

libtiff/tif_dirwrite.c:1671:1: Parameter `count`
                1669. /************************************************************************/
                1670. 
                1671. static int
                      ^
                1672. TIFFWriteDirectoryTagLongLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value)
                1673. {

libtiff/tif_dirwrite.c:1698:9: Call
                1696.     */
                1697. 
                1698.     p = _TIFFmalloc(count*sizeof(uint32));
                              ^
                1699.     if (p==NULL)
                1700.     {

libtiff/tif_unix.c:312:17: Assignment
                  310. {
                  311.         if (s == 0)
                  312.                 return ((void *) NULL);
                                       ^
                  313. 
                  314. 	return (malloc((size_t) s));

libtiff/tif_dirwrite.c:1698:5: Assignment
                1696.     */
                1697. 
                1698.     p = _TIFFmalloc(count*sizeof(uint32));
                          ^
                1699.     if (p==NULL)
                1700.     {

libtiff/tif_dirwrite.c:1717:7: Call
                1715.     }
                1716. 
                1717.     o=TIFFWriteDirectoryTagCheckedLongArray(tif,ndir,dir,tag,count,p);
                            ^
                1718.     _TIFFfree(p);
                1719. 

libtiff/tif_dirwrite.c:2088:1: Parameter `*value`
                  2086. }
                  2087. 
                  2088. static int
                        ^
                  2089. TIFFWriteDirectoryTagCheckedLongArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint32* value)
                  2090. {

libtiff/tif_dirwrite.c:2094:3: Call
                  2092. 	assert(sizeof(uint32)==4);
                  2093. 	if (tif->tif_flags&TIFF_SWAB)
                  2094. 		TIFFSwabArrayOfLong(value,count);
                          ^
                  2095. 	return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_LONG,count,count*4,value));
                  2096. }

libtiff/tif_swab.c:102:1: <Length trace>
100. 
101. #if defined(DISABLE_CHECK_TIFFSWABMACROS) || !defined(TIFFSwabArrayOfLong)
102. void
     ^
103. TIFFSwabArrayOfLong(register uint32* lp, tmsize_t n)
104. {

libtiff/tif_swab.c:102:1: Parameter `*lp`
                    100. 
                    101. #if defined(DISABLE_CHECK_TIFFSWABMACROS) || !defined(TIFFSwabArrayOfLong)
                    102. void
                         ^
                    103. TIFFSwabArrayOfLong(register uint32* lp, tmsize_t n)
                    104. {

libtiff/tif_swab.c:110:3: Assignment
                    108. 	/* XXX unroll loop some */
                    109. 	while (n-- > 0) {
                    110. 		cp = (unsigned char *)lp;
                           ^
                    111. 		t = cp[3]; cp[3] = cp[0]; cp[0] = t;
                    112. 		t = cp[2]; cp[2] = cp[1]; cp[1] = t;

libtiff/tif_swab.c:111:7: Array access: Offset: [3, +oo] (⇐ [0, +oo] + 3) Size: [0, +oo] by call to `update_output_file` 
                    109. 	while (n-- > 0) {
                    110. 		cp = (unsigned char *)lp;
                    111. 		t = cp[3]; cp[3] = cp[0]; cp[0] = t;
                               ^
                    112. 		t = cp[2]; cp[2] = cp[1]; cp[1] = t;
                    113. 		lp++;
