Blame SOURCES/libtiff-getimage-64bit.patch

6456d8
Fix misbehavior on 64-bit machines when trying to flip a downsampled image
6456d8
vertically: unsigned ints will be widened to 64 bits the wrong way.
6456d8
See RH bug #583081.
6456d8
6456d8
Filed upstream at http://bugzilla.maptools.org/show_bug.cgi?id=2207
6456d8
6456d8
6456d8
diff -Naur tiff-3.9.2.orig/libtiff/tif_getimage.c tiff-3.9.2/libtiff/tif_getimage.c
6456d8
--- tiff-3.9.2.orig/libtiff/tif_getimage.c	2009-08-30 12:21:46.000000000 -0400
6456d8
+++ tiff-3.9.2/libtiff/tif_getimage.c	2010-06-10 15:07:28.000000000 -0400
6456d8
@@ -1846,6 +1846,7 @@
6456d8
 DECLAREContigPutFunc(putcontig8bitYCbCr22tile)
6456d8
 {
6456d8
 	uint32* cp2;
6456d8
+	int32 incr = 2*toskew+w;
6456d8
 	(void) y;
6456d8
 	fromskew = (fromskew / 2) * 6;
6456d8
 	cp2 = cp+w+toskew;
6456d8
@@ -1872,8 +1873,8 @@
6456d8
 			cp2 ++ ;
6456d8
 			pp += 6;
6456d8
 		}
6456d8
-		cp += toskew*2+w;
6456d8
-		cp2 += toskew*2+w;
6456d8
+		cp += incr;
6456d8
+		cp2 += incr;
6456d8
 		pp += fromskew;
6456d8
 		h-=2;
6456d8
 	}
6456d8
@@ -1939,6 +1940,7 @@
6456d8
 DECLAREContigPutFunc(putcontig8bitYCbCr12tile)
6456d8
 {
6456d8
 	uint32* cp2;
6456d8
+	int32 incr = 2*toskew+w;
6456d8
 	(void) y;
6456d8
 	fromskew = (fromskew / 2) * 4;
6456d8
 	cp2 = cp+w+toskew;
6456d8
@@ -1953,8 +1955,8 @@
6456d8
 			cp2 ++;
6456d8
 			pp += 4;
6456d8
 		} while (--x);
6456d8
-		cp += toskew*2+w;
6456d8
-		cp2 += toskew*2+w;
6456d8
+		cp += incr;
6456d8
+		cp2 += incr;
6456d8
 		pp += fromskew;
6456d8
 		h-=2;
6456d8
 	}