diff --git a/tools/rgb2ycbcr.c b/tools/rgb2ycbcr.c index a2771757..ff8846d1 100644 --- a/tools/rgb2ycbcr.c +++ b/tools/rgb2ycbcr.c @@ -1,4 +1,4 @@ -/* $Header: /cvs/maptools/cvsroot/libtiff/tools/rgb2ycbcr.c,v 1.3 1999-12-27 17:35:01 mwelles Exp $ */ +/* $Header: /cvs/maptools/cvsroot/libtiff/tools/rgb2ycbcr.c,v 1.4 2000-10-19 13:23:49 warmerda Exp $ */ /* * Copyright (c) 1991-1997 Sam Leffler @@ -241,9 +241,10 @@ cvtRaster(TIFF* tif, uint32* raster, uint32 width, uint32 height) uint32 rwidth = roundup(width, horizSubSampling); uint32 rheight = roundup(height, vertSubSampling); uint32 nrows = (rowsperstrip > rheight ? rheight : rowsperstrip); + uint32 rnrows = roundup(nrows,vertSubSampling); - cc = nrows*rwidth + - 2*((nrows*rwidth) / (horizSubSampling*vertSubSampling)); + cc = rnrows*rwidth + + 2*((rnrows*rwidth) / (horizSubSampling*vertSubSampling)); buf = (unsigned char*)_TIFFmalloc(cc); for (y = height; (int32) y > 0; y -= nrows) { uint32 nr = (y > nrows ? nrows : y);