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

tools/tiffcrop.c:7981:11: Call
7979.     if (config == PLANARCONFIG_CONTIG)
7980.       {
7981.       if (writeBufferToContigTiles (out, crop_buff, length, width, spp, dump))
                ^
7982.         TIFFError("","Unable to write contiguous tile data for page %d", pagenum);
7983.       }

tools/tiffcrop.c:1232:1: Parameter `out->tif_dir.td_nstrips`
  1230.  * to be written out as a tile.
  1231.  */
  1232. static int writeBufferToContigTiles (TIFF* out, uint8* buf, uint32 imagelength,
        ^
  1233. 				       uint32 imagewidth, tsample_t spp, 
  1234.                                        struct dump_opts* dump)

tools/tiffcrop.c:8004:8: Call
8002.     }
8003. 
8004.   if (!TIFFWriteDirectory(out))
             ^
8005.     {
8006.     TIFFError("","Failed to write IFD for page number %d", pagenum);

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:531:11: Call
    529. 				if (!isTiled(tif))
    530. 				{
    531. 					if (!TIFFWriteDirectoryTagLongLong8Array(tif,&ndir,dir,TIFFTAG_STRIPBYTECOUNTS,tif->tif_dir.td_nstrips,tif->tif_dir.td_stripbytecount))
                   ^
    532. 						goto bad;
    533. 				}

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 `TIFFWriteDirectory` 
          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++;
