Blame SOURCES/libtiff-3samples.patch

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