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

tools/tiff2pdf.c:5578:16: Call
5576. 				streamlen=written;
5577. 				t2p_read_tiff_size_tile(t2p, input, i2);
5578. 				written += t2p_readwrite_pdf_image_tile(t2p, input, output, i2);
                     ^
5579. 				t2p_write_advance_directory(t2p, output);
5580. 				if(t2p->t2p_error!=T2P_ERR_OK){return(0);}

tools/tiff2pdf.c:2799:1: Parameter `output->tif_dir.td_nstrips`
  2797.  */
  2798. 
  2799. tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_t tile){
        ^
  2800. 
  2801. 	uint16 edge=0;

tools/tiff2pdf.c:5579:5: Call
5577. 				t2p_read_tiff_size_tile(t2p, input, i2);
5578. 				written += t2p_readwrite_pdf_image_tile(t2p, input, output, i2);
5579. 				t2p_write_advance_directory(t2p, output);
          ^
5580. 				if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
5581. 				streamlen=written-streamlen;

tools/tiff2pdf.c:3653:1: Parameter `output->tif_dir.td_nstrips`
  3651.  */
  3652. 
  3653. void
        ^
  3654. t2p_write_advance_directory(T2P* t2p, TIFF* output)
  3655. {

tools/tiff2pdf.c:3657:6: Call
  3655. {
  3656. 	t2p_disable(output);
  3657. 	if(!TIFFWriteDirectory(output)){
             ^
  3658. 		TIFFError(TIFF2PDF_MODULE, 
  3659. 			"Error writing virtual directory to output PDF %s", 

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