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

tools/tiffsplit.c:87:9: Call
85. 			if (out == NULL)
86. 				return (-2);
87. 			if (!tiffcp(in, out))
            ^
88. 				return (-1);
89. 			TIFFClose(out);

tools/tiffsplit.c:155:1: Parameter `out->tif_dir.td_samplesperpixel`
  153. }
  154. 
  155. static int
       ^
  156. tiffcp(TIFF* in, TIFF* out)
  157. {

tools/tiffsplit.c:223:11: Call
  221. 	CopyField(TIFFTAG_FAXDCS, stringv);
  222. 	if (TIFFIsTiled(in))
  223. 		return (cpTiles(in, out));
                 ^
  224. 	else
  225. 		return (cpStrips(in, out));

tools/tiffsplit.c:262:1: Parameter `out->tif_dir.td_samplesperpixel`
    260. }
    261. 
    262. static int
         ^
    263. cpTiles(TIFF* in, TIFF* out)
    264. {

tools/tiffsplit.c:89:4: Call
87. 			if (!tiffcp(in, out))
88. 				return (-1);
89. 			TIFFClose(out);
       ^
90. 		} while (TIFFReadDirectory(in));
91. 		(void) TIFFClose(in);

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

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_samplesperpixel`
        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_samplesperpixel`
          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_samplesperpixel`
            359. }
            360. 
            361. static int
                 ^
            362. TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
            363. {

libtiff/tif_dirwrite.c:588:10: Call
            586. 			if (TIFFFieldSet(tif,FIELD_SMINSAMPLEVALUE))
            587. 			{
            588. 				if (!TIFFWriteDirectoryTagSampleformatArray(tif,&ndir,dir,TIFFTAG_SMINSAMPLEVALUE,tif->tif_dir.td_samplesperpixel,tif->tif_dir.td_sminsamplevalue))
                          ^
            589. 					goto bad;
            590. 			}

libtiff/tif_dirwrite.c:1012:1: Parameter `count`
              1010. }
              1011. 
              1012. static int
                    ^
              1013. TIFFWriteDirectoryTagSampleformatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, double* value)
              1014. {

libtiff/tif_dirwrite.c:1019:9: Call
              1017. 	uint32 i;
              1018. 	int ok;
              1019. 	conv = _TIFFmalloc(count*sizeof(double));
                            ^
              1020. 	if (conv == NULL)
              1021. 	{

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:1019:2: Assignment
              1017. 	uint32 i;
              1018. 	int ok;
              1019. 	conv = _TIFFmalloc(count*sizeof(double));
                     ^
              1020. 	if (conv == NULL)
              1021. 	{

libtiff/tif_dirwrite.c:1057:10: Call
              1055. 				for (i = 0; i < count; ++i)
              1056. 					((int32*)conv)[i] = TIFFClampDoubleToInt32(value[i]);
              1057. 				ok = TIFFWriteDirectoryTagSlongArray(tif,ndir,dir,tag,count,(int32*)conv);
                             ^
              1058. 			}
              1059. 			break;

libtiff/tif_dirwrite.c:1408:1: Parameter `*value`
                1406. #endif
                1407. 
                1408. static int
                      ^
                1409. TIFFWriteDirectoryTagSlongArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int32* value)
                1410. {

libtiff/tif_dirwrite.c:1416:9: Call
                1414. 		return(1);
                1415. 	}
                1416. 	return(TIFFWriteDirectoryTagCheckedSlongArray(tif,ndir,dir,tag,count,value));
                              ^
                1417. }
                1418. 

libtiff/tif_dirwrite.c:2111:1: Parameter `*value`
                  2109. #endif
                  2110. 
                  2111. static int
                        ^
                  2112. TIFFWriteDirectoryTagCheckedSlongArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int32* value)
                  2113. {

libtiff/tif_dirwrite.c:2117:3: Call
                  2115. 	assert(sizeof(int32)==4);
                  2116. 	if (tif->tif_flags&TIFF_SWAB)
                  2117. 		TIFFSwabArrayOfLong((uint32*)value,count);
                          ^
                  2118. 	return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SLONG,count,count*4,value));
                  2119. }

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