/* Decode a tile/strip and apply the predictor routine. Note that horizontal differencing must be done on a row-by-row basis. The width of a "row" has already been calculated at pre-decode time according to the strip/tile dimensions.  */
static int PredictorDecodeTile(TIFF *tif, uint8 *op0, tmsize_t occ0, uint16 s)
/* Decode a tile/strip and apply the predictor routine. Note that horizontal differencing must be done on a row-by-row basis. The width of a "row" has already been calculated at pre-decode time according to the strip/tile dimensions.  */
static int PredictorDecodeTile(TIFF *tif, uint8 *op0, tmsize_t occ0, uint16 s)
{
	TIFFPredictorState *sp = PredictorState(tif);
	assert(sp != NULL);
	assert(sp->decodetile != NULL);
	if ((*sp->decodetile)(tif, op0, occ0, s)) {
		tmsize_t rowsize = sp->rowsize;
		assert(rowsize > 0);
		if((occ0%rowsize) !=0)
        {
            TIFFErrorExt(tif->tif_clientdata, "PredictorDecodeTile",
                         "%s", "occ0%rowsize != 0");
            return 0;
        }
		assert(sp->decodepfunc != NULL);
		while (occ0 > 0) {
			if( !(*sp->decodepfunc)(tif, op0, rowsize) )
                return 0;
			occ0 -= rowsize;
			op0 += rowsize;
		}
		return 1;
	} else
		return 0;
}