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

tools/tiffcp.c:165:9: Call
163. 		if (tif) {
164. 			**imageSpec = comma;  /* replace the comma */
165. 			if (!nextSrcImage(tif, imageSpec)) {
             ^
166. 				TIFFClose (tif);
167. 				tif = NULL;

tools/tiffcp.c:117:1: Parameter `tif->tif_dir.td_samplesperpixel`
  115. }
  116. 
  117. static int nextSrcImage (TIFF *tif, char **imageSpec)
       ^
  118. /*
  119.   seek to the next image specified in *imageSpec

tools/tiffcp.c:166:5: Call
164. 			**imageSpec = comma;  /* replace the comma */
165. 			if (!nextSrcImage(tif, imageSpec)) {
166. 				TIFFClose (tif);
         ^
167. 				tif = NULL;
168. 			}

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:53:13: Call
      51. 
      52.     if ((tif->tif_flags & (TIFF_DIRTYDIRECT|TIFF_DIRTYSTRIP)) 
      53.         && !TIFFRewriteDirectory(tif))
                      ^
      54.         return (0);
      55. 

libtiff/tif_dirwrite.c:274:1: Parameter `tif->tif_dir.td_samplesperpixel`
        272.  * previously used directory space. 
        273.  */ 
        274. int
             ^
        275. TIFFRewriteDirectory( TIFF *tif )
        276. {

libtiff/tif_dirwrite.c:281:10: Call
        279. 	/* We don't need to do anything special if it hasn't been written. */
        280. 	if( tif->tif_diroff == 0 )
        281. 		return TIFFWriteDirectory( tif );
                      ^
        282. 
        283. 	/*

libtiff/tif_dirwrite.c:193:1: Parameter `tif->tif_dir.td_samplesperpixel`
          191.  * storage that's been changed.
          192.  */
          193. int
               ^
          194. TIFFWriteDirectory(TIFF* tif)
          195. {

libtiff/tif_dirwrite.c:196:9: Call
          194. TIFFWriteDirectory(TIFF* tif)
          195. {
          196. 	return TIFFWriteDirectorySec(tif,TRUE,TRUE,NULL);
                       ^
          197. }
          198. 

libtiff/tif_dirwrite.c:420:1: Parameter `tif->tif_dir.td_samplesperpixel`
            418. }
            419. 
            420. static int
                 ^
            421. TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
            422. {

libtiff/tif_dirwrite.c:647:10: Call
            645. 			if (TIFFFieldSet(tif,FIELD_SMINSAMPLEVALUE))
            646. 			{
            647. 				if (!TIFFWriteDirectoryTagSampleformatArray(tif,&ndir,dir,TIFFTAG_SMINSAMPLEVALUE,tif->tif_dir.td_samplesperpixel,tif->tif_dir.td_sminsamplevalue))
                          ^
            648. 					goto bad;
            649. 			}

libtiff/tif_dirwrite.c:1092:1: Parameter `count`
              1090. }
              1091. 
              1092. static int
                    ^
              1093. TIFFWriteDirectoryTagSampleformatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, double* value)
              1094. {

libtiff/tif_dirwrite.c:1099:9: Call
              1097. 	uint32 i;
              1098. 	int ok;
              1099. 	conv = _TIFFmalloc(count*sizeof(double));
                            ^
              1100. 	if (conv == NULL)
              1101. 	{

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:1099:2: Assignment
              1097. 	uint32 i;
              1098. 	int ok;
              1099. 	conv = _TIFFmalloc(count*sizeof(double));
                     ^
              1100. 	if (conv == NULL)
              1101. 	{

libtiff/tif_dirwrite.c:1137:10: Call
              1135. 				for (i = 0; i < count; ++i)
              1136. 					((int32*)conv)[i] = TIFFClampDoubleToInt32(value[i]);
              1137. 				ok = TIFFWriteDirectoryTagSlongArray(tif,ndir,dir,tag,count,(int32*)conv);
                             ^
              1138. 			}
              1139. 			break;

libtiff/tif_dirwrite.c:1488:1: Parameter `*value`
                1486. #endif
                1487. 
                1488. static int
                      ^
                1489. TIFFWriteDirectoryTagSlongArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int32* value)
                1490. {

libtiff/tif_dirwrite.c:1496:9: Call
                1494. 		return(1);
                1495. 	}
                1496. 	return(TIFFWriteDirectoryTagCheckedSlongArray(tif,ndir,dir,tag,count,value));
                              ^
                1497. }
                1498. 

libtiff/tif_dirwrite.c:2314:1: Parameter `*value`
                  2312. #endif
                  2313. 
                  2314. static int
                        ^
                  2315. TIFFWriteDirectoryTagCheckedSlongArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int32* value)
                  2316. {

libtiff/tif_dirwrite.c:2320:3: Call
                  2318. 	assert(sizeof(int32)==4);
                  2319. 	if (tif->tif_flags&TIFF_SWAB)
                  2320. 		TIFFSwabArrayOfLong((uint32*)value,count);
                          ^
                  2321. 	return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SLONG,count,count*4,value));
                  2322. }

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