Blame SOURCES/libtiff-3samples.patch

0e6869
Patch for bug #603081: failure to guard against bogus SamplesPerPixel
0e6869
when converting a YCbCr image to RGB.
0e6869
0e6869
This patch duplicates into PickContigCase() a safety check that already
0e6869
existed in PickSeparateCase().
0e6869
0e6869
Filed upstream at http://bugzilla.maptools.org/show_bug.cgi?id=2216
0e6869
0e6869
0e6869
diff -Naur tiff-3.9.2.orig/libtiff/tif_getimage.c tiff-3.9.2/libtiff/tif_getimage.c
0e6869
--- tiff-3.9.2.orig/libtiff/tif_getimage.c	2009-08-30 12:21:46.000000000 -0400
0e6869
+++ tiff-3.9.2/libtiff/tif_getimage.c	2010-06-11 12:06:47.000000000 -0400
0e6869
@@ -2397,7 +2397,7 @@
0e6869
 			}
0e6869
 			break;
0e6869
 		case PHOTOMETRIC_YCBCR:
0e6869
-			if (img->bitspersample == 8)
0e6869
+			if ((img->bitspersample==8) && (img->samplesperpixel==3))
0e6869
 			{
0e6869
 				if (initYCbCrConversion(img)!=0)
0e6869
 				{