Sophie

Sophie

distrib > Mandriva > 2009.1 > x86_64 > by-pkgid > 1d68596e2a82b14e65301e6b0567f47c > files > 3

libtiff-3.8.2-13.2mdv2009.1.src.rpm

Patch for bug #603081: failure to guard against bogus SamplesPerPixel
when converting a YCbCr image to RGB.

Filed upstream at http://bugzilla.maptools.org/show_bug.cgi?id=2216


diff -Naur tiff-3.8.2.orig/libtiff/tif_getimage.c tiff-3.8.2/libtiff/tif_getimage.c
--- tiff-3.8.2.orig/libtiff/tif_getimage.c	2005-12-27 06:28:23.000000000 -0500
+++ tiff-3.8.2/libtiff/tif_getimage.c	2010-06-16 21:41:12.000000000 -0400
@@ -2384,7 +2384,7 @@
 	    }
 	    break;
 	case PHOTOMETRIC_YCBCR:
-	    if (img->bitspersample == 8)
+	    if (img->bitspersample == 8 && img->samplesperpixel==3)
 		put = initYCbCrConversion(img);
 	    break;
 	case PHOTOMETRIC_CIELAB: