Blame SOURCES/libtiff-3samples.patch

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