https://github.com/libsdl-org/libtiff/commit/998e6e2f186e7b201f4e4efa6a37392fbb262dfc
From 998e6e2f186e7b201f4e4efa6a37392fbb262dfc Mon Sep 17 00:00:00 2001
From: Andrey Kiselev <[EMAIL REDACTED]>
Date: Fri, 2 Jul 2010 10:03:07 +0000
Subject: [PATCH] *** empty log message ***
---
ChangeLog | 4 ++++
libtiff/tif_getimage.c | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 03703234..4be54d2d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2010-07-02 Andrey Kiselev <dron@ak4719.spb.edu>
+ * libtiff/tif_getimage.c: Check the number of samples per pixel when
+ working with YCbCr image in PickContigCase(). As per bug
+ http://bugzilla.maptools.org/show_bug.cgi?id=2216
+
* libtiff/tif_dir.c: Set the bogus post-decoding hook when processing
TIFFTAG_BITSPERSAMPLE in _TIFFVSetField() for the case of 8 bit when
we don't need any post-processing. That helps to reset the hook if we
diff --git a/libtiff/tif_getimage.c b/libtiff/tif_getimage.c
index 38455fbc..a3ca4328 100644
--- a/libtiff/tif_getimage.c
+++ b/libtiff/tif_getimage.c
@@ -1,4 +1,4 @@
-/* $Id: tif_getimage.c,v 1.63.2.4 2010-06-08 18:50:42 bfriesen Exp $ */
+/* $Id: tif_getimage.c,v 1.63.2.5 2010-07-02 10:03:07 dron Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
@@ -2397,7 +2397,7 @@ PickContigCase(TIFFRGBAImage* img)
}
break;
case PHOTOMETRIC_YCBCR:
- if (img->bitspersample == 8)
+ if ((img->bitspersample==8) && (img->samplesperpixel==3))
{
if (initYCbCrConversion(img)!=0)
{