Blame SOURCES/libtiff-coverity.patch

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