Blame SOURCES/libtiff-coverity.patch

21ff78
diff --git a/tools/ppm2tiff.c b/tools/ppm2tiff.c
21ff78
index 81ffa3d..a02e865 100644
21ff78
--- a/tools/ppm2tiff.c
21ff78
+++ b/tools/ppm2tiff.c
21ff78
@@ -285,6 +285,8 @@ main(int argc, char* argv[])
21ff78
 		if (TIFFWriteScanline(out, buf, row, 0) < 0)
21ff78
 			break;
21ff78
 	}
21ff78
+	if (in != stdin)
21ff78
+		fclose(in);
21ff78
 	(void) TIFFClose(out);
21ff78
 	if (buf)
21ff78
 		_TIFFfree(buf);
21ff78
diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c
21ff78
index bd23c9e..a15a3ef 100644
21ff78
--- a/tools/tiff2pdf.c
21ff78
+++ b/tools/tiff2pdf.c
21ff78
@@ -3020,6 +3020,7 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_
21ff78
                                         "for t2p_readwrite_pdf_image_tile, %s", 
21ff78
 					(unsigned long) t2p->tiff_datasize, 
21ff78
 					TIFFFileName(input));
21ff78
+				_TIFFfree(buffer);
21ff78
 				t2p->t2p_error = T2P_ERR_ERROR;
21ff78
 				return(0);
21ff78
 			}
21ff78
@@ -3747,11 +3748,11 @@ t2p_sample_rgbaa_to_rgb(tdata_t data, uint32 samplecount)
21ff78
 {
21ff78
 	uint32 i;
21ff78
 	
21ff78
-    /* For the 3 first samples, there is overlapping between souce and
21ff78
-       destination, so use memmove().
21ff78
-       See http://bugzilla.maptools.org/show_bug.cgi?id=2577 */
21ff78
-    for(i = 0; i < 3 && i < samplecount; i++)
21ff78
-        memmove((uint8*)data + i * 3, (uint8*)data + i * 4, 3);
21ff78
+	/* For the 3 first samples, there is overlapping between souce and
21ff78
+	   destination, so use memmove().
21ff78
+	   See http://bugzilla.maptools.org/show_bug.cgi?id=2577 */
21ff78
+	for(i = 0; i < 3 && i < samplecount; i++)
21ff78
+		memmove((uint8*)data + i * 3, (uint8*)data + i * 4, 3);
21ff78
 	for(; i < samplecount; i++)
21ff78
 		memcpy((uint8*)data + i * 3, (uint8*)data + i * 4, 3);
21ff78